本文整理汇总了C++中wxString::ToLongLong方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::ToLongLong方法的具体用法?C++ wxString::ToLongLong怎么用?C++ wxString::ToLongLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::ToLongLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StringToULongLong
bool StringToULongLong(const wxString &str, wxULongLong &_result)
{
wxULongLong_t result = 0;
wxLongLong_t test;
bool bResult, bResultTest;
#if wxCHECK_VERSION(2,7,2)
bResultTest = str.ToLongLong(&test);
if(test < 0 && bResultTest) {
return false;
}
// supported first with 2.7.2
bResult = str.ToULongLong(&result);
#else
bResult = false;
(void)test;
(void)bResultTest;
#endif
if(!bResult) {
// this is ONLY the case, if the number is a) too big
// or b) we are using mingw
result = StrToULongLong(str, bResult);
}
if(bResult) {
_result = result;
}
return bResult;
}
示例2: BuildFromXML
/// Constructs a ODPCMAliasBlockFile from the xml output of WriteXML.
/// Does not schedule the ODPCMAliasBlockFile for OD loading. Client code must do this.
// BuildFromXML methods should always return a BlockFile, not NULL,
// even if the result is flawed (e.g., refers to nonexistent file),
// as testing will be done in DirManager::ProjectFSCK().
BlockFilePtr ODPCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
{
wxFileNameWrapper summaryFileName;
wxFileNameWrapper aliasFileName;
sampleCount aliasStart = 0;
size_t aliasLen = 0;
int aliasChannel=0;
long nValue;
long long nnValue;
while(*attrs)
{
const wxChar *attr = *attrs++;
const wxChar *value = *attrs++;
if (!value)
break;
const wxString strValue = value;
if (!wxStricmp(attr, wxT("summaryfile")) &&
// Can't use XMLValueChecker::IsGoodFileName here, but do part of its test.
XMLValueChecker::IsGoodFileString(strValue) &&
(strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= PLATFORM_MAX_PATH))
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.
summaryFileName.Clear();
}
else if( !wxStricmp(attr, wxT("aliasfile")) )
{
if (XMLValueChecker::IsGoodPathName(strValue))
aliasFileName.Assign(strValue);
else if (XMLValueChecker::IsGoodFileName(strValue, dm.GetProjectDataDir()))
// Allow fallback of looking for the file name, located in the data directory.
aliasFileName.Assign(dm.GetProjectDataDir(), strValue);
else if (XMLValueChecker::IsGoodPathString(strValue))
// If the aliased file is missing, we failed XMLValueChecker::IsGoodPathName()
// and XMLValueChecker::IsGoodFileName, because both do existence tests,
// but we want to keep the reference to the missing file because it's a good path string.
aliasFileName.Assign(strValue);
}
else if ( !wxStricmp(attr, wxT("aliasstart")) )
{
if (XMLValueChecker::IsGoodInt64(strValue) &&
strValue.ToLongLong(&nnValue) && (nnValue >= 0))
aliasStart = nnValue;
}
else if (XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
{ // integer parameters
if (!wxStricmp(attr, wxT("aliaslen")) && (nValue >= 0))
aliasLen = nValue;
else if (!wxStricmp(attr, wxT("aliaschannel")) && XMLValueChecker::IsValidChannel(aliasChannel))
aliasChannel = nValue;
}
}
return make_blockfile<ODPCMAliasBlockFile>
(std::move(summaryFileName), std::move(aliasFileName),
aliasStart, aliasLen, aliasChannel, 0, 0, 0, false);
}
示例3: FromString
bool wxNumberFormatter::FromString(wxString s, wxLongLong_t *val)
{
RemoveThousandsSeparators(s);
return s.ToLongLong(val);
}