本文整理汇总了C++中Flag::is_ccstr方法的典型用法代码示例。如果您正苦于以下问题:C++ Flag::is_ccstr方法的具体用法?C++ Flag::is_ccstr怎么用?C++ Flag::is_ccstr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flag
的用法示例。
在下文中一共展示了Flag::is_ccstr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_flag
// Implementation of "setflag" command
static jint set_flag(AttachOperation* op, outputStream* out) {
const char* name = NULL;
if ((name = op->arg(0)) == NULL) {
out->print_cr("flag name is missing");
return JNI_ERR;
}
Flag* f = Flag::find_flag((char*)name, strlen(name));
if (f && f->is_external() && f->is_writeable()) {
if (f->is_bool()) {
return set_bool_flag(name, op, out);
} else if (f->is_intx()) {
return set_intx_flag(name, op, out);
} else if (f->is_uintx()) {
return set_uintx_flag(name, op, out);
} else if (f->is_uint64_t()) {
return set_uint64_t_flag(name, op, out);
} else if (f->is_ccstr()) {
return set_ccstr_flag(name, op, out);
} else {
ShouldNotReachHere();
return JNI_ERR;
}
} else {
return AttachListener::pd_set_flag(op, out);
}
}
示例2: ccstrAt
Flag::Error CommandLineFlags::ccstrAt(const char* name, size_t len, ccstr* 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_ccstr()) return Flag::WRONG_FORMAT;
*value = result->get_ccstr();
return Flag::SUCCESS;
}
示例3: ccstrAtPut
// Contract: Flag will make private copy of the incoming value.
// Outgoing value is always malloc-ed, and caller MUST call free.
bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return false;
if (!result->is_ccstr()) return false;
ccstr old_value = result->get_ccstr();
trace_flag_changed<EventStringFlagChanged, const char*>(name, old_value, *value, origin);
char* new_value = NULL;
if (*value != NULL) {
new_value = NEW_C_HEAP_ARRAY(char, strlen(*value)+1, mtInternal);
strcpy(new_value, *value);
}
示例4: ccstrAtPut
Flag::Error CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin) {
Flag* faddr = address_of_flag(flag);
guarantee(faddr != NULL && faddr->is_ccstr(), "wrong flag type");
ccstr old_value = faddr->get_ccstr();
trace_flag_changed<EventStringFlagChanged, const char*>(faddr->_name, old_value, value, origin);
char* new_value = os::strdup_check_oom(value);
faddr->set_ccstr(new_value);
if (!faddr->is_default() && old_value != NULL) {
// Prior value is heap allocated so free it.
FREE_C_HEAP_ARRAY(char, old_value);
}
faddr->set_origin(origin);
return Flag::SUCCESS;
}