本文整理汇总了C++中CStrRef::toInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ CStrRef::toInt64方法的具体用法?C++ CStrRef::toInt64怎么用?C++ CStrRef::toInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStrRef
的用法示例。
在下文中一共展示了CStrRef::toInt64方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Set
bool IniSetting::Set(CStrRef name, CStrRef value) {
CallbackMap::iterator iter = s_callbacks->find(name.data());
if (iter != s_callbacks->end()) {
return (*iter->second.callback)(value, iter->second.p);
}
if (name == "memory_limit") {
if (!value.empty()) {
int64_t newInt = value.toInt64();
char lastChar = value.charAt(value.size() - 1);
if (lastChar == 'K' || lastChar == 'k') {
newInt <<= 10;
} else if (lastChar == 'M' || lastChar == 'm') {
newInt <<= 20;
} else if (lastChar == 'G' || lastChar == 'g') {
newInt <<= 30;
}
g_context->setRequestMemoryMaxBytes(newInt);
return true;
}
} else if (name == "max_execution_time" || name == "maximum_execution_time") {
int64_t limit = value.toInt64();
TimeoutThread::DeferTimeout(limit);
// Just for ini_get
g_context->setRequestTimeLimit(limit);
return true;
} else if (name == "arg_separator.output") {
g_context->setArgSeparatorOutput(value);
return true;
} else if (name == "log_errors") {
bool log;
ini_on_update_bool(value, &log);
g_context->setLogErrors(log);
return true;
} else if (name == "error_log") {
g_context->setErrorLog(value);
return true;
} else if (name == "notice_frequency") {
RuntimeOption::NoticeFrequency = value.toInt64();
return true;
} else if (name == "warning_frequency") {
RuntimeOption::WarningFrequency = value.toInt64();
return true;
} else if (name == "include_path") {
g_context->setIncludePath(value);
return true;
}
return false;
}
示例2: Set
bool IniSetting::Set(CStrRef name, CStrRef value) {
CallbackMap::iterator iter = s_callbacks->find(name.data());
if (iter != s_callbacks->end()) {
return (*iter->second.callback)(value, iter->second.p);
}
if (name == s_memory_limit) {
if (!value.empty()) {
int64_t newInt = value.toInt64();
char lastChar = value.charAt(value.size() - 1);
if (lastChar == 'K' || lastChar == 'k') {
newInt <<= 10;
} else if (lastChar == 'M' || lastChar == 'm') {
newInt <<= 20;
} else if (lastChar == 'G' || lastChar == 'g') {
newInt <<= 30;
}
g_context->setRequestMemoryMaxBytes(newInt);
return true;
}
} else if (name == s_max_execution_time || name == s_maximum_execution_time){
int64_t limit = value.toInt64();
ThreadInfo::s_threadInfo.getNoCheck()->
m_reqInjectionData.setTimeout(limit);
return true;
} else if (name == s_arg_separator_output) {
g_context->setArgSeparatorOutput(value);
return true;
} else if (name == s_log_errors) {
bool log;
ini_on_update_bool(value, &log);
g_context->setLogErrors(log);
return true;
} else if (name == s_error_log) {
g_context->setErrorLog(value);
return true;
} else if (name == s_notice_frequency) {
RuntimeOption::NoticeFrequency = value.toInt64();
return true;
} else if (name == s_warning_frequency) {
RuntimeOption::WarningFrequency = value.toInt64();
return true;
} else if (name == s_include_path) {
g_context->setIncludePath(value);
return true;
}
return false;
}
示例3: ini_on_update_non_negative
bool ini_on_update_non_negative(CStrRef value, void *p) {
int64_t v = value.toInt64();
if (v < 0) {
return false;
}
if (p) {
*((int64_t*)p) = v;
}
return true;
}
示例4: ini_on_update_long
bool ini_on_update_long(CStrRef value, void *p) {
if (p) {
*((int64_t*)p) = value.toInt64();
}
return true;
}