本文整理汇总了C++中Flag::get_intx方法的典型用法代码示例。如果您正苦于以下问题:C++ Flag::get_intx方法的具体用法?C++ Flag::get_intx怎么用?C++ Flag::get_intx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flag
的用法示例。
在下文中一共展示了Flag::get_intx方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intxAt
Flag::Error CommandLineFlags::intxAt(const char* name, size_t len, intx* value, bool allow_locked, bool return_flag) {
Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
if (result == NULL) return Flag::INVALID_FLAG;
if (!result->is_intx()) return Flag::WRONG_FORMAT;
*value = result->get_intx();
return Flag::SUCCESS;
}
示例2: intxAtPut
void CommandLineFlagsEx::intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin) {
Flag* faddr = address_of_flag(flag);
guarantee(faddr != NULL && faddr->is_intx(), "wrong flag type");
trace_flag_changed<EventLongFlagChanged, s8>(faddr->_name, faddr->get_intx(), value, origin);
faddr->set_intx(value);
faddr->set_origin(origin);
}
示例3: check_ranges
bool CommandLineFlagRangeList::check_ranges() {
// Check ranges.
bool status = true;
for (int i=0; i<length(); i++) {
CommandLineFlagRange* range = at(i);
const char* name = range->name();
Flag* flag = Flag::find_flag(name, strlen(name), true, true);
// We must check for NULL here as lp64_product flags on 32 bit architecture
// can generate range check (despite that they are declared as constants),
// but they will not be returned by Flag::find_flag()
if (flag != NULL) {
if (flag->is_int()) {
int value = flag->get_int();
if (range->check_int(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_uint()) {
uint value = flag->get_uint();
if (range->check_uint(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_intx()) {
intx value = flag->get_intx();
if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_uintx()) {
uintx value = flag->get_uintx();
if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_uint64_t()) {
uint64_t value = flag->get_uint64_t();
if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_size_t()) {
size_t value = flag->get_size_t();
if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
} else if (flag->is_double()) {
double value = flag->get_double();
if (range->check_double(value, true) != Flag::SUCCESS) status = false;
}
}
}
return status;
}