本文整理汇总了C++中wxString::ToULongLong方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::ToULongLong方法的具体用法?C++ wxString::ToULongLong怎么用?C++ wxString::ToULongLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::ToULongLong方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: TryParseFPR
bool CRegTable::TryParseFPR(wxString str, FormatSpecifier format, unsigned long long* value)
{
if (format == FormatSpecifier::Hex16)
{
return str.ToULongLong(value, 16);
}
if (format == FormatSpecifier::Double)
{
double double_val;
if (str.ToCDouble(&double_val))
{
std::memcpy(value, &double_val, sizeof(u64));
return true;
}
return false;
}
return false;
}
示例3: cbDebuggerStringToAddress
uint64_t cbDebuggerStringToAddress(const wxString &address)
{
if (address.empty())
return 0;
#if defined(__WXMSW__)
// Workaround for the 'ToULongLong' bug in wxWidgets 2.8.12
#if wxCHECK_VERSION(2, 8, 12)
return strtoull(address.mb_str(), nullptr, 16);
#else
uint64_t result;
if (address.ToULongLong(&result))
return result;
else
return 0;
#endif // wxCHECK_VERSION
#else
uint64_t result;
if (address.ToULong(&result, 16))
return result;
else
return 0;
#endif
}
示例4:
static u64 StrToU64(const wxString& str, int base = 10)
{
wxULongLong_t l;
str.ToULongLong(&l, base);
return l;
}
示例5: ParseData
void CUpdater::ParseData()
{
const wxLongLong ownVersionNumber = CBuildInfo::ConvertToVersionNumber(CBuildInfo::GetVersion().c_str());
version_information_ = version_information();
wxString raw_version_information = raw_version_information_;
log_ += wxString::Format(_("Parsing %d bytes of version information.\n"), static_cast<int>(raw_version_information.size()));
while( !raw_version_information.empty() ) {
wxString line;
int pos = raw_version_information.Find('\n');
if (pos != -1) {
line = raw_version_information.Left(pos);
raw_version_information = raw_version_information.Mid(pos + 1);
}
else {
line = raw_version_information;
raw_version_information.clear();
}
wxStringTokenizer tokens(line, _T(" \t\n"), wxTOKEN_STRTOK);
if( !tokens.CountTokens() ) {
// After empty line, changelog follows
version_information_.changelog = raw_version_information;
version_information_.changelog.Trim(true);
version_information_.changelog.Trim(false);
if( COptions::Get()->GetOptionVal(OPTION_LOGGING_DEBUGLEVEL) == 4 ) {
log_ += wxString::Format(_T("Changelog: %s\n"), version_information_.changelog);
}
break;
}
if( tokens.CountTokens() != 2 && tokens.CountTokens() != 6 ) {
if( COptions::Get()->GetOptionVal(OPTION_LOGGING_DEBUGLEVEL) == 4 ) {
log_ += wxString::Format(_T("Skipping line with %d tokens\n"), static_cast<int>(tokens.CountTokens()));
}
continue;
}
wxString type = tokens.GetNextToken();
wxString versionOrDate = tokens.GetNextToken();
if (type == _T("nightly")) {
wxDateTime nightlyDate;
if( !nightlyDate.ParseFormat(versionOrDate, _T("%Y-%m-%d")) ) {
if( COptions::Get()->GetOptionVal(OPTION_LOGGING_DEBUGLEVEL) == 4 ) {
log_ += _T("Could not parse nightly date\n");
}
continue;
}
wxDateTime buildDate = CBuildInfo::GetBuildDate();
if (!buildDate.IsValid() || !nightlyDate.IsValid() || nightlyDate <= buildDate) {
if( COptions::Get()->GetOptionVal(OPTION_LOGGING_DEBUGLEVEL) == 4 ) {
log_ += _T("Nightly isn't newer\n");
}
continue;
}
}
else {
wxLongLong v = CBuildInfo::ConvertToVersionNumber(versionOrDate.c_str());
if (v <= ownVersionNumber)
continue;
}
build* b = 0;
if( type == _T("nightly") && UpdatableBuild() ) {
b = &version_information_.nightly_;
}
else if( type == _T("release") ) {
b = &version_information_.stable_;
}
else if( type == _T("beta") ) {
b = &version_information_.beta_;
}
if( b ) {
b->version_ = versionOrDate;
if( UpdatableBuild() && tokens.CountTokens() == 4 ) {
wxString const url = tokens.GetNextToken();
wxString const sizestr = tokens.GetNextToken();
wxString const hash_algo = tokens.GetNextToken();
wxString const hash = tokens.GetNextToken();
if( GetFilename(url).empty() ) {
if( COptions::Get()->GetOptionVal(OPTION_LOGGING_DEBUGLEVEL) == 4 ) {
log_ += wxString::Format(_T("Could not extract filename from URL: %s\n"), url);
}
continue;
}
if( hash_algo.CmpNoCase(_T("sha512")) ) {
continue;
}
unsigned long long l = 0;
if( !sizestr.ToULongLong(&l) ) {
//.........这里部分代码省略.........