本文整理汇总了C++中VString::FindUniChar方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::FindUniChar方法的具体用法?C++ VString::FindUniChar怎么用?C++ VString::FindUniChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VString
的用法示例。
在下文中一共展示了VString::FindUniChar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetChangeListNumber
/*
IMPORTANT: the build version is created on the compilation machine. It requires that (1) perl is installed and (2) an external file contains the number.
That's why if you compile 4D on your computer, you'll probably always get a build version of 0 (if the external file is not found, "00000" is used)
*/
sLONG VProcess::GetChangeListNumber() const
{
sLONG changeListNumber = 0;
VString s;
GetBuildNumber( s);
VIndex pos = s.FindUniChar( '.', s.GetLength(), true);
if (pos > 0)
{
s.SubString( pos + 1, s.GetLength() - pos);
changeListNumber = s.GetLong();
}
return changeListNumber;
}
示例2: SetBinaryPath
void XWinProcessLauncher::SetBinaryPath(const VString &inBinaryPath)
{
delete [] fBinaryPath;
fBinaryPath = NULL;
// ACI0065260 - 2010-03-11, T.A.
// Add quotes if the path contains a space and is not already quoted
if( !inBinaryPath.IsEmpty() && inBinaryPath.FindUniChar(CHAR_SPACE) > 0 && inBinaryPath[0] != CHAR_QUOTATION_MARK )
{
VString quotedPath;
quotedPath = CHAR_QUOTATION_MARK;
quotedPath += inBinaryPath;
quotedPath += CHAR_QUOTATION_MARK;
fBinaryPath = _CreateCString(quotedPath);
}
else
{
fBinaryPath = _CreateCString(inBinaryPath);
}
}
示例3: JSONObjectToBag
VError VJSONImporter::JSONObjectToBag(VValueBag& outBag)
{
VError err = VE_OK;
VString aStr;
bool withQuotes;
// When JSONObjectToBag() recursively calls itself (because it finds a jsonBeginObject token)
// it must not error-check this, because the token has already been read.
if (fRecursiveCallCount == 0 && GetNextJSONToken(aStr, &withQuotes) != jsonBeginObject)
{
err = VE_MALFORMED_JSON_DESCRIPTION;
}
else
{
VString name;
JsonToken token = GetNextJSONToken(name, &withQuotes);
while (token != jsonEndObject && token != jsonNone && err == VE_OK)
{
if (token == jsonString)
{
token = GetNextJSONToken(aStr, &withQuotes);
if (token == jsonAssigne)
{
token = GetNextJSONToken(aStr, &withQuotes);
switch (token)
{
case jsonString:
if(name == "__CDATA")
{
outBag.SetCData(aStr);
}
else if (withQuotes)
{
outBag.SetString(name, aStr);
}
else if (aStr == L"null")
{
//aStr.SetNull(true);
outBag.SetString(name, aStr);
VValueSingle* temp = outBag.GetAttribute(name);
aStr.SetNull(true);
outBag.SetString(name, aStr);
}
else if (aStr == L"true")
{
outBag.SetBool(name, true);
}
else if (aStr == L"false")
{
outBag.SetBool(name, false);
}
else if (aStr.FindUniChar('.') > 0)
{
outBag.SetReal(name, aStr.GetReal());
}
else
{
outBag.SetLong8(name, aStr.GetLong8());
}
break;
case jsonBeginObject:
{
VValueBag* subBag = new VValueBag();
subBag->SetBool(L"____objectunic", true);
++fRecursiveCallCount;
err = JSONObjectToBag(*subBag);
--fRecursiveCallCount;
if (err == VE_OK)
{
outBag.AddElement(name, subBag);
}
subBag->Release();
}
break;
case jsonBeginArray:
{
token = GetNextJSONToken(aStr, &withQuotes);
while (token != jsonEndArray && token != jsonNone && err == VE_OK)
{
if (token == jsonBeginObject)
{
VValueBag* subBag = new VValueBag();
++fRecursiveCallCount;
err = JSONObjectToBag(*subBag);
--fRecursiveCallCount;
if (err == VE_OK)
{
outBag.AddElement(name, subBag);
}
subBag->Release();
}
token = GetNextJSONToken(aStr, &withQuotes);
if (token == jsonSeparator)
token = GetNextJSONToken(aStr, &withQuotes);
}
}
//.........这里部分代码省略.........