• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ JString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中JString函数的典型用法代码示例。如果您正苦于以下问题:C++ JString函数的具体用法?C++ JString怎么用?C++ JString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了JString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

void
GLFitParameterTable::GetValueString
	(
	JString* text
	)
{
	const JSize count	= itsNameList->GetElementCount();
	for (JIndex i = 1; i <= count; i++)
		{
		JString* str	= itsNameList->NthElement(i);
		JFloat start	= itsStartValues->GetElement(i);
		JFloat fit		= itsFitValues->GetElement(i);
		JFloat error	= itsErrorValues->GetElement(i);
		*text += *str + "\n\t";
		if (itsHasStartValues)
			{
			*text += "Start value: " + JString(start, JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 6);
			text->Append("\n\t");
			}
		*text += "Fit value:   " + JString(fit, JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 6);
		text->Append("\n\t");
		*text += "Error value: " + JString(error, JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 6);
		text->AppendCharacter('\n');
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:GLFitParameterTable.cpp


示例2: SetHasParameterErrors

void
JPlotLinearFit::JPlotLinearFitX
	(
	J2DPlotWidget* plot,
	JPlotDataBase* fitData,
	const JBoolean xlog,
	const JBoolean ylog
	)
{
	SetHasParameterErrors(kJTrue);
	SetParameterCount(2);
	SetHasGoodnessOfFit(kJTrue);
	itsXIsLog = xlog;
	itsYIsLog = ylog;
	if (!xlog && !ylog)
		{
		itsFunctionName = jnew JString("y = a+bx");
		}
	else if (!xlog && ylog)
		{
		itsFunctionName = jnew JString("y = a Exp(bx)");
		}
	itsRealCount = 0;
	GenerateFit();
	GenerateDiffData();
	if (itsYIsLog && !itsXIsLog)
		{
		AdjustDiffData();
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:30,代码来源:JPlotLinearFit.cpp


示例3: JString

JString
JPrintFileSize
	(
	const JSize size
	)
{
	if (size < 8192)
		{
		return JString(size, 0);
		}
	else if (size < 1048576)
		{
		return JString(size/1024.0, 0) + "K";
		}
	else if (size < 134217728)
		{
		return JString(size/1048576.0, 1) + "M";
		}
	else if (size < 1073741824)
		{
		return JString(size/1048576.0, 0) + "M";
		}
	else
		{
		return JString(size/1073741824.0, 1) + "G";
		}
}
开发者ID:mta1309,项目名称:mulberry-lib-jx,代码行数:27,代码来源:jFileUtil.cpp


示例4: GetFontManager

void
FitParmsTable::Append
	(
	const JCharacter* col1, 
	const JCharacter* col2
	)
{
	
	const JFontManager* fm = GetFontManager();
	JSize lineHeight = fm->GetDefaultFont().GetLineHeight();
	AppendRows(1, lineHeight + 2);
	JString* str = jnew JString(col1);
	itsCol1->Append(str);
	JSize col1Width = GetColWidth(1);
	JSize strWidth = fm->GetDefaultFont().GetStringWidth(*str);
	if (strWidth + 10 > col1Width)
		{
		SetColWidth(1, strWidth + 10);
		}
	str = jnew JString(col2);
	itsCol2->Append(str);
	JSize col2Width = GetColWidth(2);
	strWidth = fm->GetDefaultFont().GetStringWidth(*str);
	if (strWidth + 10 > col2Width)
		{
		SetColWidth(2, strWidth + 10);
		}
	TableRefresh();
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:29,代码来源:FitParmsTable.cpp


示例5: JString

JString
JStopWatch::FormatTimeInterval
	(
	const JFloat time
	)
{
	JString timeString;
	if (time < 60.0)									// less than 1 min
		{
		timeString = JString(time) + " seconds";
		}
	else if (time < 3600.0)								// less than 1 hour
		{
		timeString = JString(time/60.0) + " minutes";
		}
	else if (time < 86400.0)							// less than 1 day
		{
		timeString = JString(time/3600.0) + " hours";
		}
	else
		{
		timeString = JString(time/86400.0) + " days";
		}

	return timeString;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:26,代码来源:JStopWatch.cpp


示例6: GetData

JString
GPrefsMgr::GetSMTPUser()
{
	if (IDValid(kSMTPUserID))
		{
		std::string data;
		const JBoolean ok = GetData(kSMTPUserID, &data);
		assert( ok );

		std::istringstream dataStream(data);

		JString user;
		dataStream >> user;
		if (!user.IsEmpty())
			{
			return user;
			}
		}
	JCharacter* name = getenv("LOGNAME");
	if (name == NULL)
		{
		return JString();
		}
	return JString(name);
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:25,代码来源:GPrefsMgr.cpp


示例7: JString

JString JTNGObj::outputTag(int n) {
  if (n < 2) {
    char* tag[] = { "Sync", "Clock"};
    return JString(tag[n])+NBTag();
  }
  return JString("ch-")+JInteger::toJString(n-1)+NBTag();
}
开发者ID:neattools,项目名称:neattools,代码行数:7,代码来源:JTNGObj.cpp


示例8: if

void
GLPolyFitDialog::Receive
	(
	JBroadcaster* 	sender, 
	const Message&	message
	)
{
	if (sender == itsHelpButton && message.Is(JXButton::kPushed))
		{
		}
	else if (message.Is(JXCheckbox::kPushed))
		{
		JString fStr;
		JBoolean started	= kJFalse;
		const JSize count	= 10;
		for (JIndex i = 1; i <= count; i++)
			{
			if (itsCB[i-1]->IsChecked())
				{
				if (started)
					{
					fStr += " + ";
					}
				else
					{
					started	= kJTrue;
					}
				JString parm	= "a" + JString(i - 1, JString::kBase10);
				JString xTerm	= " * x";
				if (i > 2)
					{
					xTerm += "^" + JString(i - 1, JString::kBase10);
					}
				fStr += parm;
				if (i > 1)
					{
					fStr += xTerm;
					}
				}
			}
		if (fStr.IsEmpty())
			{
			itsFn->Hide();
			}
		else
			{
			itsFn->Show();
			JFunction* f;
			if (JParseFunction(fStr, itsVarList, &f))
				{
				itsFn->SetFunction(itsVarList, f);
				}
			}
		}
	else
		{
		JXDialogDirector::Receive(sender, message);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:59,代码来源:GLPolyFitDialog.cpp


示例9: JString

JString JTNG4Obj::outputTag(int n) {
  if (n < OUT_COM) {
    char* tag[] = { "Sync", "Clock"};
    return JString(tag[n])+NBTag();
  } if (n == OUT_COM) {
    return "COM";
  }
  return JString("ch-")+JInteger::toJString(n-2)+NBTag();
}
开发者ID:neattools,项目名称:neattools,代码行数:9,代码来源:JTNG4Obj.cpp


示例10: JString

void JUploadPlugin::putDownloadLink(JNIEnv* env, jobject jthis, jstring urlDownload, jstring killLink)
{
    JUploadPlugin* This = static_cast<JUploadPlugin*>(getCObject(jthis));
    QString klink, dlink = JString(urlDownload).str();

    if (killLink)
        klink = JString(killLink).str();
    static_cast<JavaUpload*>(This->m_transfer)->putDownloadLink(dlink, klink);
}
开发者ID:ActionLuzifer,项目名称:fatrat,代码行数:9,代码来源:JUploadPlugin.cpp


示例11: setNValue

boolean J1DMObj::updateProperty(JProperty& prop) {
     if (JNBitsObj::updateProperty(prop)) return true;
     if (prop.getName() == JString("vx")) {
          setNValue(0, ((JIntegerProperty*)&prop)->value);
          return true;
	 } else if (prop.getName() == JString("vy")) {
           setNValue(1, ((JIntegerProperty*)&prop)->value);
           return true;
	 }
     return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:11,代码来源:J1DMObj.cpp


示例12: setDelay

boolean JTimerObj::updateProperty(JProperty& prop) {
  if (JANDObj::updateProperty(prop)) return true;
  if (prop.getName() == JString("delay")) {
    setDelay(((JIntegerProperty*)&prop)->value);
    return true;
  } else if (prop.getName() == JString("priority")) {
    priority = ((JIntegerListProperty*)&prop)->value;
    return true;
  }
  return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:11,代码来源:JTimerObj.cpp


示例13: sizeof

JString JBlockTcpSocket::GetLocalIP()
{
	sockaddr_in addr;
	int len = sizeof(sockaddr_in);
	if( ::getsockname(m_socket, LPSOCKADDR(&addr), &len) != SOCKET_ERROR ){
		TCHAR outIP[32];
		unsigned char* ip = reinterpret_cast<unsigned char*>(&addr.sin_addr);
		_stprintf_s(outIP, 32, _T("%d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]);
		return JString(outIP);
	}
	return JString();
}
开发者ID:luoxizhi,项目名称:JLib,代码行数:12,代码来源:JSocket.cpp


示例14: setLabel

boolean JBtnObj::updateProperty(JProperty& prop) {
  if (JNBitsObj::updateProperty(prop)) return true;
  if (prop.getName() == JString("label")) {
    setLabel(((JStringProperty*)&prop)->value);
    return true;
  } else if (prop.getName() == JString("type")) {
    type = ((JIntegerListProperty*)&prop)->value;
    repaint();
    return true;
  }
  return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:12,代码来源:JBtnObj.cpp


示例15: broadcast

boolean JDelaySustainObj::updateProperty(JProperty& prop) {
  if (JAddObj::updateProperty(prop)) return true;
  if (prop.getName() == JString("delay")) {
    delay = ((JIntegerProperty*)&prop)->value;
    broadcast(OUT_DELAY);
    return true;
  } else if (prop.getName() == JString("sustain")) {
    sustain = ((JIntegerProperty*)&prop)->value;
    broadcast(OUT_SUSTAIN);
    return true;
  }
  return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:13,代码来源:JDelaySustainObj.cpp


示例16: JString

JString
GPrefsMgr::GetArrowVersionStr()
	const
{
	std::string data;
	if (GetData(kGProgramVersionID, &data))
		{
		return JString(data);
		}
	else
		{
		return JString("< 0.5.0");		// didn't exist before this version
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:14,代码来源:GPrefsMgr.cpp


示例17: GMFilter

void
GMFilterNameTable::NewFilter()
{
	if (!itsConditionTable->OKToSwitch() || !itsActionTable->OKToSwitch())
		{
		return;
		}

	GMFilter* filter	= new GMFilter();
	assert(filter != NULL);

	itsFilters->Append(filter);

	JString nickname	= "filter" + JString(itsFilters->GetElementCount());
	filter->SetNickname(nickname);

	AppendRows(1, itsRowHeight);
	itsConditionTable->SetFilter(filter);
	itsActionTable->SetFilter(filter);

	GetTableSelection().ClearSelection();
	GetTableSelection().SelectCell(GetRowCount(), 1);

	AdjustButtons();
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:25,代码来源:GMFilterNameTable.cpp


示例18: JString

void
GMMIMEParser::WriteTextString
	(
	JString*			data,
	const GMIMEHeader&	header
	)
{
	JString filename =
		itsTextDir + JString(itsTextFileIndex) +
		"." + header.GetCharSet() + "." + header.GetSubType();
	itsTextFileIndex++;
	std::ofstream os(filename);
	if (header.GetEncoding() == kBase64Encoding)
		{
		std::istrstream is(data->GetCString(), data->GetLength());
		JDecodeBase64(is, os);
		return;
		}
		
	if (header.GetEncoding() == kQPEncoding)
		{
		ParseQuotedPrintable(data);
		}
	data->Print(os);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:25,代码来源:GMMIMEParser.cpp


示例19: while

JBoolean
GAddressBookMgr::NewNickName
	(
	const JCharacter* addresses,
	JString*		  name
	)
{
	JString alias = "Untitled";
	JIndex count  = 1;
	GAddressBookEntry* entry;
	while (itsAddresses->GetElement(alias, &entry))
		{
		count++;
		if (count >= 100)
			{
			return kJFalse;
			}
		alias = "Untitled" + JString(count);
		}
	entry = new GAddressBookEntry();
	assert(entry != NULL);
	JString add(addresses);
	if (add.IsEmpty())
		{
		add = "nobody";
		}
	entry->address = add;
	itsAddresses->SetElement(alias, entry, JPtrArrayT::kDelete);
	*name = alias;
	return kJTrue;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:31,代码来源:GAddressBookMgr.cpp


示例20: setValue

boolean JLEDObj::updateProperty(JProperty& prop) {
  if (JModuleObj::updateProperty(prop)) return true;
  if (prop.getName() == JString("value")) {
    setValue(((JIntegerProperty*)&prop)->value);
    return true;
  } else if (prop.getName() == JString("color")) {
    color = ((JColorProperty*)&prop)->color;
    repaintView(*this);
    return true;
  } else if (prop.getName() == JString("bkgnd")) {
    bkgnd = ((JColorProperty*)&prop)->color;
    repaintView(*this);
    return true;
  }
  return false;
}
开发者ID:neattools,项目名称:neattools,代码行数:16,代码来源:JLEDObj.cpp



注:本文中的JString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ JUNLIKELY函数代码示例发布时间:2022-05-30
下一篇:
C++ JS_malloc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap