本文整理汇总了C++中ObjectWrapper::is_null方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectWrapper::is_null方法的具体用法?C++ ObjectWrapper::is_null怎么用?C++ ObjectWrapper::is_null使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectWrapper
的用法示例。
在下文中一共展示了ObjectWrapper::is_null方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: obj
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
bool
SuifPrinterModule::print_catchall(ostream& output,
const ObjectWrapper &obj,
const LString &name,
int _indent,int deref = 0)
{
const Address what = obj.get_address();
const MetaClass* type = obj.get_meta_class();
int field_deref = deref?deref-1:0;
output << type->get_instance_name()
<< '(' << type->get_meta_class_id() << ") ";
if (name)
output << ' ' << name << ' ';
output << " (un-implemented) ";
Iterator* it = type->get_iterator(what);
if (it) {
if (it->current()) {
//output << "{\n";
output << endl;
//while (it->is_valid()) {
for (; it->is_valid(); it->next())
{
ObjectWrapper obj(it->current(), it->current_meta_class());
// const MetaClass* currentMetaClass = it->current_meta_class();
// const Address curAddr = it->current();
if(!obj.is_null()) {
// if (curAddr) {
indent(output, _indent+istep);
print2(output, obj, it->current_name(),
_indent+istep, field_deref);
}
// it->next();
//}
}// while (it->is_valid());
indent(output, _indent);
//output << "}\n";
}
else
output <<" {0x0}\n";
}
if (it) delete it;
return true;
}
示例2: if
//.........这里部分代码省略.........
output << ii->to_String().c_str();
}
else if (!strcmp(buff, "i")) { // Deal with printing int
output << *(int*)what;
}
else if (!strcmp(buff, "f")) { // float
output << *(float*)what;
}
else if (!strcmp(buff, "d")) { // double
output << *(double*)what;
}
else if (!strcmp(buff, "c")) { // char
output << *(char*)what;
}
else if (!strcmp(buff, "b")) { // byte
output << (int)*(char*)what;
}
else if (!strcmp(buff, "B")) { // bool
output << *(bool*)what;
}
else if (!strcmp(buff, "ls")) { // Deal with printing LStrings
LString str = *(LString*) what;
output << str;
}
else if (!strcmp(buff, "s")) { // Deal with printing Strings
String str = *(String*) what;
output << str;
}
else if (!strcmp(buff, "n")) { // Deal with name of field
if (!deref)
output << name;
}
else if (!strcmp(buff, "P")) {
if (obj.is_null())
output << "NULL";
else {
PointerWrapper ptr_obj(obj);
ObjectWrapper base_obj = ptr_obj.dereference();
if (ptr_obj.get_meta_class()->is_owning_pointer()) {
size_t ref = retrieve_tag(obj.get_object());
output << "t" << ref<< ": ";
print2(output, base_obj, emptyLString,
_indent+istep, field_deref);
}
else {
print_pointer(output, ptr_obj, emptyLString, _indent, deref);
}
}
}
else if (!strcmp(buff, "R")) { // print the ref #
if (!what)
output << "NULL";
else {
// PointerMetaClass *p = (PointerMetaClass*) type;
// const Address baseAddr = *(Address*) type;
//ObjectWrapper obj(what, type);
size_t ref = retrieve_tag(obj);
output << "t" << ref<< ": ";
}
}
else if (!strcmp(buff, "LS")) {
list_separator = ' ';
}
else if (!strcmp(buff, "LN")) {
list_separator = '\n';
}