本文整理汇总了C++中Flag::is_uint方法的典型用法代码示例。如果您正苦于以下问题:C++ Flag::is_uint方法的具体用法?C++ Flag::is_uint怎么用?C++ Flag::is_uint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flag
的用法示例。
在下文中一共展示了Flag::is_uint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uintAt
Flag::Error CommandLineFlags::uintAt(const char* name, size_t len, uint* 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_uint()) return Flag::WRONG_FORMAT;
*value = result->get_uint();
return Flag::SUCCESS;
}
示例2: 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;
}
示例3: uintAtPut
Flag::Error CommandLineFlagsEx::uintAtPut(CommandLineFlagWithType flag, uint value, Flag::Flags origin) {
Flag* faddr = address_of_flag(flag);
guarantee(faddr != NULL && faddr->is_uint(), "wrong flag type");
return CommandLineFlags::uintAtPut(faddr, &value, origin);
}