当前位置: 首页>>代码示例>>C++>>正文


C++ JString::Contains方法代码示例

本文整理汇总了C++中JString::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::Contains方法的具体用法?C++ JString::Contains怎么用?C++ JString::Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JString的用法示例。


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

示例1: if

void
JXButton::SetShortcuts
	(
	const JCharacter* list
	)
{
	JXWindow* w = GetWindow();
	w->ClearShortcuts(this);
	w->InstallShortcuts(this, list);

	const JBoolean wasReturnButton = itsIsReturnButtonFlag;
	itsIsReturnButtonFlag = kJFalse;
	if (list != NULL)
		{
		JString shortcuts = list;
		if (shortcuts.Contains("^M") || shortcuts.Contains("^m"))
			{
			itsIsReturnButtonFlag = kJTrue;
			}
		}

	const JSize borderWidth = GetBorderWidth();
	if (!wasReturnButton && itsIsReturnButtonFlag)
		{
		SetBorderWidth(borderWidth+1);
		}
	else if (wasReturnButton && !itsIsReturnButtonFlag && borderWidth > 0)
		{
		SetBorderWidth(borderWidth-1);
		}

	Refresh();
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:33,代码来源:JXButton.cpp

示例2:

inline JBoolean
JXFontManager::IsPostscript
	(
	const JString& name
	)
	const
{
#if ONLY_STD_PS_FONTS

	return JI2B(name == "Arial"                     ||	// Helvetica sucks on OS X
				name.BeginsWith("Courier")          ||
				name.BeginsWith("Helvetica")        ||
				name == "Symbol"                    ||
				name == "Times"                     ||
				name.Contains("Bookman")            ||
				name.Contains("Century Schoolbook") ||
				name.Contains("Chancery")           ||
				name.Contains("Palatino"));

#else

	return kJTrue;

#endif
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例3:

inline JBoolean
cbIsQualified
	(
	const JString& s
	)
{
	return JI2B(s.Contains(":") || s.Contains("."));
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:8,代码来源:CBFnMenuUpdater.cpp

示例4: is

void
GPMProcessEntry::ReadStat()
{
	const JSize uTime = itsUTime, sTime = itsSTime;

	JString str = JCombinePathAndName(itsProcPath, "stat");
	std::ifstream is(str);
	if (is.good())
		{
		is >> itsPID;
		is >> std::ws;
		itsCommand = JReadUntilws(is);
		if (itsCommand.GetLength() > 2)
			{
			itsCommand = itsCommand.GetSubstring(2, itsCommand.GetLength() - 1);
			}
		JString state = JReadUntilws(is);
		if (state.Contains("S"))
			{
			itsState = kSleep;
			}
		else if (state.Contains("D"))
			{
			itsState = kUnIntSleep;
			}
		else if (state.Contains("Z"))
			{
			itsState = kZombie;
			}
		else if (state.Contains("T"))
			{
			itsState = kStopped;
			}
		else
			{
			itsState = kRun;
			}
		is >> itsPPID;
		is >> std::ws;
		int toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> toss;
		is >> itsUTime;
		is >> itsSTime;
		is >> toss;
		is >> toss;
		is >> itsPriority;
		is >> itsNice;
		}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:56,代码来源:GPMProcessEntry.cpp

示例5: input

JBoolean
JSearchFile
	(
	const JCharacter*	fileName,
	const JCharacter*	searchStr,
	const JBoolean		caseSensitive,
	JIndex*				lineIndex
	)
{
	ifstream input(fileName);

	*lineIndex = 0;
	while (!input.eof())
		{
		(*lineIndex)++;
		const JString line = JReadLine(input);
		if (input.fail())
			{
			break;
			}
		if (line.Contains(searchStr, caseSensitive))
			{
			return kJTrue;
			}
		}

	return kJFalse;
}
开发者ID:mta1309,项目名称:mulberry-lib-jx,代码行数:28,代码来源:jFileUtil.cpp

示例6: sizeof

void
JWebBrowser::ShowFileLocation
	(
	const JCharacter* fileName
	)
{
	if (!JStringEmpty(itsShowFileLocationCmd))
		{
		JString fullName = fileName;
		JStripTrailingDirSeparator(&fullName);

		JString path, name;
		JSplitPathAndName(fullName, &path, &name);

		const JCharacter* map[] =
			{
			kFileVarName, fullName,
			kPathVarName, path
			};

		JString s = itsShowFileLocationCmd;
		if (!s.Contains("$"))
			{
			s += " '$";
			s += kFileVarName;
			s += "'";
			}
		(JGetStringManager())->Replace(&s, map, sizeof(map));
		JSimpleProcess::Create(s, kJTrue);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:31,代码来源:JWebBrowser.cpp

示例7: output

void
JUpdateCVSIgnore
	(
	const JCharacter* ignoreFullName
	)
{
	JString path, name;
	JSplitPathAndName(ignoreFullName, &path, &name);
	const JString cvsFile = JCombinePathAndName(path, ".cvsignore");

	if (!JFileExists(cvsFile) && JGetVCSType(path) != kJCVSType)
		{
		return;
		}

	JString cvsData;
	JReadFile(cvsFile, &cvsData);
	if (!cvsData.IsEmpty() && !cvsData.EndsWith("\n"))
		{
		cvsData += "\n";
		}

	name += "\n";
	if (!cvsData.Contains(name))
		{
		JEditVCS(cvsFile);
		cvsData += name;

		ofstream output(cvsFile);
		cvsData.Print(output);
		}
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例8: indexStr

JString
CMLink::Build1DArrayExpressionForCFamilyLanguage
	(
	const JCharacter*	origExpr,
	const JInteger		index
	)
{
	JString expr = origExpr;

	const JString indexStr(index, 0);	// must use floating point conversion
	if (expr.Contains("$i"))
		{
		const JCharacter* map[] =
			{
			"i", indexStr.GetCString()
			};
		(JGetStringManager())->Replace(&expr, map, sizeof(map));
		}
	else
		{
		if (expr.GetFirstCharacter() != '(' ||
			expr.GetLastCharacter()  != ')')
			{
			expr.PrependCharacter('(');
			expr.AppendCharacter(')');
			}

		expr.AppendCharacter('[');
		expr += indexStr;
		expr.AppendCharacter(']');
		}

	return expr;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例9: JReadUntil

JBoolean
GAddressBookMgr::GetNextRecord
	(
	JString& line,
	JString& record,
	std::istream& is
	)
{
	if (line.IsEmpty())
		{
		return kJFalse;
		}
	JIndex index;
	if (line.LocateSubstring("\t", &index))
		{
		if (index > 1)
			{
			record = line.GetSubstring(1, index - 1);
			line.RemoveSubstring(1, index);
			return kJTrue;
			}
		line.RemoveSubstring(1, 1);
		return kJFalse;
		}
	record = line;
	if (record.Contains("(") && !record.Contains(")"))
		{
		JString temp = JReadUntil(is, ')');
		record += temp + ")";
		line = JReadLine(is);
		if (!line.IsEmpty() && (line.GetFirstCharacter() == '\t'))
			{
			line.RemoveSubstring(1, 1);
			}
		}
	else
		{
		line.Clear();
		}
	return kJTrue;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:41,代码来源:GAddressBookMgr.cpp

示例10: iStr

JString
CMLink::Build2DArrayExpressionForCFamilyLanguage
	(
	const JCharacter*	origExpr,
	const JInteger		rowIndex,
	const JInteger		colIndex
	)
{
	JString expr = origExpr;

	const JBoolean usesI = expr.Contains("$i");		// row
	const JBoolean usesJ = expr.Contains("$j");		// col

	const JString iStr(rowIndex, 0);	// must use floating point conversion
	const JString jStr(colIndex, 0);	// must use floating point conversion

	// We have to do both at the same time because otherwise we lose a $.

	if (usesI || usesJ)
		{
		const JCharacter* map[] =
			{
			"i", iStr.GetCString(),
			"j", jStr.GetCString()
			};
		(JGetStringManager())->Replace(&expr, map, sizeof(map));
		}

	if (!usesI || !usesJ)
		{
		if (expr.GetFirstCharacter() != '(' ||
			expr.GetLastCharacter()  != ')')
			{
			expr.PrependCharacter('(');
			expr.AppendCharacter(')');
			}

		if (!usesI)
			{
			expr.AppendCharacter('[');
			expr += iStr;
			expr.AppendCharacter(']');
			}
		if (!usesJ)
			{
			expr.AppendCharacter('[');
			expr += jStr;
			expr.AppendCharacter(']');
			}
		}

	return expr;
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例11: JExecute

void
CBApp::GetSystemIncludeDirectories()
{
	int pid, fd, inFD;
	const JError err = JExecute("gcc -Wp,-v -x c++ -fsyntax-only -", &pid,
								kJCreatePipe, &inFD,
								kJCreatePipe, &fd,
								kJAttachToFromFD);
	if (!err.OK())
		{
		for (const JCharacter* s : kSysIncludeDir)
			{
			itsSystemIncludeDirs->Append(s);
			}
		return;
		}

	close(inFD);

	JString s;
	while (1)
		{
		s = JReadUntil(fd, '\n');
		if (s.IsEmpty())
			{
			break;
			}

		if (s.GetFirstCharacter() == ' ')
			{
			s.RemoveSubstring(1,1);
			if (!s.Contains(" "))
				{
				itsSystemIncludeDirs->Append(s);
				}
			}
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:38,代码来源:CBApp.cpp

示例12: indexStr

JString
XDLink::Build1DArrayExpression
	(
	const JCharacter*	origExpr,
	const JInteger		index
	)
{
	JString expr = origExpr;

	const JString indexStr(index, 0);	// must use floating point conversion
	if (expr.Contains("$i"))
		{
		// double literal $'s

		for (JIndex i=expr.GetLength()-1; i>=1; i--)
			{
			if (expr.GetCharacter(i)   == '$' &&
				expr.GetCharacter(i+1) != 'i')
				{
				expr.InsertCharacter('$', i);
				}
			}

		const JCharacter* map[] =
			{
			"i", indexStr.GetCString()
			};
		(JGetStringManager())->Replace(&expr, map, sizeof(map));
		}
	else
		{
		expr.AppendCharacter('[');
		expr += indexStr;
		expr.AppendCharacter(']');
		}

	return expr;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:38,代码来源:XDLink.cpp

示例13:

JBoolean
CBSymbolList::InContext
	(
	const JString&				fullName,
	const JPtrArray<JString>&	contextNamespace,
	const JBoolean				caseSensitive
	)
	const
{
	const JSize count = contextNamespace.GetElementCount();
	for (JIndex i=1; i<=count; i+=2)
		{
		const JString* cns1 = contextNamespace.NthElement(i);
		const JString* cns2 = contextNamespace.NthElement(i+1);
		if (fullName.BeginsWith(*cns1, caseSensitive) ||
			fullName.Contains(*cns2, caseSensitive))
			{
			return kJTrue;
			}
		}

	return kJFalse;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:23,代码来源:CBSymbolList.cpp

示例14: iStr

JString
XDLink::Build2DArrayExpression
	(
	const JCharacter*	origExpr,
	const JInteger		rowIndex,
	const JInteger		colIndex
	)
{
	JString expr = origExpr;

	const JBoolean usesI = expr.Contains("$i");		// row
	const JBoolean usesJ = expr.Contains("$j");		// col

	const JString iStr(rowIndex, 0);	// must use floating point conversion
	const JString jStr(colIndex, 0);	// must use floating point conversion

	// We have to do both at the same time because otherwise we lose a $.

	if (usesI || usesJ)
		{
		// double literal $'s

		for (JIndex i=expr.GetLength()-1; i>=1; i--)
			{
			if (expr.GetCharacter(i)   == '$' &&
				expr.GetCharacter(i+1) != 'i' &&
				expr.GetCharacter(i+1) != 'j')
				{
				expr.InsertCharacter('$', i);
				}
			}

		const JCharacter* map[] =
			{
			"i", iStr.GetCString(),
			"j", jStr.GetCString()
			};
		(JGetStringManager())->Replace(&expr, map, sizeof(map));
		}

	if (!usesI || !usesJ)
		{
		if (expr.GetFirstCharacter() != '(' ||
			expr.GetLastCharacter()  != ')')
			{
			expr.PrependCharacter('(');
			expr.AppendCharacter(')');
			}

		if (!usesI)
			{
			expr.AppendCharacter('[');
			expr += iStr;
			expr.AppendCharacter(']');
			}
		if (!usesJ)
			{
			expr.AppendCharacter('[');
			expr += jStr;
			expr.AppendCharacter(']');
			}
		}

	return expr;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:65,代码来源:XDLink.cpp

示例15: is

void
GFGLink::ParseInterface
	(
	GFGMemberFunction* 	fn,
	const JIndex 		line
	)
{
	std::ifstream is(itsCurrentFile);
	if (!is.good())
		{
		return;
		}

	// skip to the function's line
	JString str;
	for (JIndex i = 1; i < line; i++)
		{
		str	= JReadLine(is);
		}

	JSize p1	= JTellg(is);

	is >> std::ws;
	str	= JReadUntilws(is);
	if (str != "virtual")
		{
		return;
		}

	is >> std::ws;

	// return type
	str	= JReadUntilws(is);
	if (str	== "const")
		{
		str	+= " " + JReadUntilws(is);
		}
	fn->SetReturnType(str);

	is >> std::ws;

	// this should be the function name
	str	= JReadUntil(is, '(');
	str.TrimWhitespace();
	if (str != fn->GetFnName())
		{
		return;
		}

	// get arguments
	JCharacter delim	= ',';
	while (delim == ',')
		{
		JBoolean ok	= JReadUntil(is, 2, ",)", &str, &delim);
		if (!ok)
			{
			return;
			}
		JIndex findex;
		if (str.LocateSubstring("//", &findex))
			{
			JIndex eindex;
			if (str.LocateSubstring("\n", &eindex) &&
				eindex >= findex)
				{
				str.RemoveSubstring(findex, eindex);
				}
			}
		str.TrimWhitespace();
		if (!str.IsEmpty())
			{
			fn->AddArg(str);
			}		
		}

	is >> std::ws;

	// is it const;
	str	= JReadUntil(is, ';');
	if (str.Contains("const"))
		{
		fn->ShouldBeConst(kJTrue);
		}

	JSize p2	= JTellg(is);
	JSeekg(is, p1);

	str	= JRead(is, p2 - p1);
	fn->SetInterface(str);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:90,代码来源:GFGLink.cpp


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