本文整理汇总了C++中ValueObject类的典型用法代码示例。如果您正苦于以下问题:C++ ValueObject类的具体用法?C++ ValueObject怎么用?C++ ValueObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ValueObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getValue
bool CornerNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
Corner* pObject = dynamic_cast<Corner*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Type")
{
if (pObject->hasValue_Type())
{
strValue = (EnumCornerTypeImpl(pObject->getType())).toString();
bValueSet = true;
}
}
return bValueSet;
}
开发者ID:klainqin,项目名称:LandXmlSDK,代码行数:42,代码来源:LXNodes62.cpp
示例2: getValue
bool DesignHourNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
DesignHour* pObject = dynamic_cast<DesignHour*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Volume")
{
if (pObject->hasValue_Volume())
{
strValue = (DoubleObjectImpl(pObject->getVolume())).toString();
bValueSet = true;
}
}
return bValueSet;
}
开发者ID:klainqin,项目名称:LandXmlSDK,代码行数:42,代码来源:LXNodes61.cpp
示例3: getValue
bool OffsetValsNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
OffsetVals* pObject = dynamic_cast<OffsetVals*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"OffsetInOut")
{
if (pObject->hasValue_OffsetInOut())
{
strValue = (DoubleObjectImpl(pObject->getOffsetInOut())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"OffsetLeftRight")
{
if (pObject->hasValue_OffsetLeftRight())
{
strValue = (DoubleObjectImpl(pObject->getOffsetLeftRight())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"OffsetUpDown")
{
if (pObject->hasValue_OffsetUpDown())
{
strValue = (DoubleObjectImpl(pObject->getOffsetUpDown())).toString();
bValueSet = true;
}
}
return bValueSet;
}
开发者ID:klainqin,项目名称:LandXmlSDK,代码行数:42,代码来源:LXNodes50.cpp
示例4: getValue
bool NoPassingZoneNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
NoPassingZone* pObject = dynamic_cast<NoPassingZone*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"StaStart")
{
if (pObject->hasValue_StaStart())
{
strValue = (DoubleObjectImpl(pObject->getStaStart())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"StaEnd")
{
if (pObject->hasValue_StaEnd())
{
strValue = (DoubleObjectImpl(pObject->getStaEnd())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"SideofRoad")
{
if (pObject->hasValue_SideofRoad())
{
strValue = (EnumSideofRoadTypeImpl(pObject->getSideofRoad())).toString();
bValueSet = true;
}
}
return bValueSet;
}
开发者ID:klainqin,项目名称:LandXmlSDK,代码行数:42,代码来源:LXNodes1.cpp
示例5: getValue
bool CrossSectSurfNode::getValue (const String& strMemberName, String& strValue)
{
bool bValueSet = false;
CrossSectSurf* pObject = dynamic_cast<CrossSectSurf*>(m_pObject);
if (strMemberName == L"value")
{
ValueObject* pValueObj = dynamic_cast<ValueObject*>(m_pObject);
if (pValueObj)
{
if (!pValueObj->isNothing())
{
strValue = pValueObj->toString();
bValueSet = true;
}
}
}
else if (strMemberName == L"Name")
{
if (pObject->hasValue_Name())
{
strValue = (StringObjectImpl(pObject->getName())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"Desc")
{
if (pObject->hasValue_Desc())
{
strValue = (StringObjectImpl(pObject->getDesc())).toString();
bValueSet = true;
}
}
else if (strMemberName == L"State")
{
if (pObject->hasValue_State())
{
strValue = (EnumStateTypeImpl(pObject->getState())).toString();
bValueSet = true;
}
}
return bValueSet;
}
开发者ID:klainqin,项目名称:LandXmlSDK,代码行数:42,代码来源:LXNodes21.cpp
示例6: compiler_type
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{
CompilerType compiler_type(valobj.GetCompilerType());
bool is_signed;
// ObjC objects can only be pointers (or numbers that actually represents pointers
// but haven't been typecast, because reasons..)
if (!compiler_type.IsIntegerType (is_signed) && !compiler_type.IsPointerType ())
return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
return false;
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
return GetObjectDescription(str, val, exe_ctx.GetBestExecutionContextScope());
}
开发者ID:RichardsonAlex,项目名称:lldb,代码行数:20,代码来源:AppleObjCRuntime.cpp
示例7: exe_ctx
bool
AppleObjCRuntime::GetObjectDescription (Stream &str, ValueObject &valobj)
{
bool is_signed;
// ObjC objects can only be pointers, but we extend this to integer types because an expression might just
// result in an address, and we should try that to see if the address is an ObjC object.
if (!(valobj.IsPointerType() || valobj.IsIntegerType(is_signed)))
return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
return false;
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
return GetObjectDescription(str, val, exe_ctx.GetBestExecutionContextScope());
}
开发者ID:Narupol,项目名称:lldb,代码行数:20,代码来源:AppleObjCRuntime.cpp
示例8: ValueObject
ValueObjectSynthetic::ValueObjectSynthetic (ValueObject &parent, lldb::SyntheticChildrenSP filter) :
ValueObject(parent),
m_synth_sp(filter),
m_children_byindex(),
m_name_toindex(),
m_synthetic_children_count(UINT32_MAX),
m_parent_type_name(parent.GetTypeName()),
m_might_have_children(eLazyBoolCalculate),
m_provides_value(eLazyBoolCalculate)
{
#ifdef FOOBAR
std::string new_name(parent.GetName().AsCString());
new_name += "$$__synth__";
SetName (ConstString(new_name.c_str()));
#else
SetName(parent.GetName());
#endif
CopyValueData(m_parent);
CreateSynthFilter();
}
开发者ID:fengsi,项目名称:freebsd,代码行数:20,代码来源:ValueObjectSyntheticFilter.cpp
示例9: decode_value
bool decode_value(Buffer& buf, ValueObject& value, bool copyRawValue)
{
value.Clear();
if (!BufferHelper::ReadFixUInt8(buf, value.type))
{
return false;
}
switch (value.type)
{
case EMPTY:
{
break;
}
case INTEGER:
{
if (!BufferHelper::ReadVarInt64(buf, value.v.int_v))
{
return false;
}
break;
}
case DOUBLE:
{
if (!BufferHelper::ReadFixDouble(buf, value.v.double_v))
{
return false;
}
break;
}
default:
{
uint32_t len;
if (!BufferHelper::ReadVarUInt32(buf, len)
|| buf.ReadableBytes() < len)
{
return false;
}
if (copyRawValue)
{
value.v.raw = new Buffer(len);
buf.Read(value.v.raw, len);
}
else
{
const char* tmp = buf.GetRawReadBuffer();
value.v.raw = new Buffer(const_cast<char*>(tmp), 0, len);
buf.SkipBytes(len);
}
break;
}
}
return true;
}
开发者ID:Ivasek,项目名称:ardb,代码行数:54,代码来源:ardb_data.cpp
示例10:
bool
lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
if (const char* description = valobj.GetObjectDescription())
{
stream.Printf("%s", description);
return true;
}
else
return false;
}
开发者ID:2asoft,项目名称:freebsd,代码行数:11,代码来源:Cocoa.cpp
示例11: ConstString
ConstString
FormatManager::GetTypeForCache (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
{
ValueObjectSP valobj_sp = valobj.GetQualifiedRepresentationIfAvailable(use_dynamic, valobj.IsSynthetic());
if (valobj_sp && valobj_sp->GetCompilerType().IsValid())
{
if (!valobj_sp->GetCompilerType().IsMeaninglessWithoutDynamicResolution())
return valobj_sp->GetQualifiedTypeName();
}
return ConstString();
}
开发者ID:RichardsonAlex,项目名称:lldb,代码行数:12,代码来源:FormatManager.cpp
示例12: g_StringCoreType
bool
lldb_private::formatters::swift::NSContiguousString_SummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
static ConstString g_StringCoreType("_TtVs11_StringCore");
lldb::addr_t core_location = valobj.GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
if (core_location == LLDB_INVALID_ADDRESS)
return false;
ProcessSP process_sp(valobj.GetProcessSP());
if (!process_sp)
return false;
size_t ptr_size = process_sp->GetAddressByteSize();
core_location += 2*ptr_size;
Error error;
InferiorSizedWord isw_1(process_sp->ReadPointerFromMemory(core_location, error),*process_sp);
InferiorSizedWord isw_2(process_sp->ReadPointerFromMemory(core_location+ptr_size, error),*process_sp);
InferiorSizedWord isw_3(process_sp->ReadPointerFromMemory(core_location+ptr_size+ptr_size, error),*process_sp);
DataBufferSP buffer_sp(new DataBufferHeap(3*ptr_size, 0));
uint8_t* buffer = buffer_sp->GetBytes();
buffer = isw_1.CopyToBuffer(buffer);
buffer = isw_2.CopyToBuffer(buffer);
buffer = isw_3.CopyToBuffer(buffer);
DataExtractor data(buffer_sp, process_sp->GetByteOrder(), ptr_size);
SwiftASTContext* lldb_swift_ast = process_sp->GetTarget().GetScratchSwiftASTContext(error);
if (!lldb_swift_ast)
return false;
CompilerType string_core_type = lldb_swift_ast->GetTypeFromMangledTypename(g_StringCoreType.GetCString(), error);
if (string_core_type.IsValid() == false)
return false;
ValueObjectSP string_core_sp = ValueObject::CreateValueObjectFromData("stringcore", data, valobj.GetExecutionContextRef(), string_core_type);
if (string_core_sp)
return StringCore_SummaryProvider(*string_core_sp, stream, options);
return false;
}
开发者ID:bob-wilson,项目名称:swift-lldb,代码行数:40,代码来源:SwiftFormatters.cpp
示例13: process_sp
bool
lldb_private::formatters::NSError_SummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options)
{
ProcessSP process_sp(valobj.GetProcessSP());
if (!process_sp)
return false;
lldb::addr_t ptr_value = LLDB_INVALID_ADDRESS;
CompilerType valobj_type(valobj.GetCompilerType());
Flags type_flags(valobj_type.GetTypeInfo());
if (type_flags.AllClear(eTypeHasValue))
{
if (valobj.IsBaseClass() && valobj.GetParent())
ptr_value = valobj.GetParent()->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
}
else
ptr_value = valobj.GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
if (ptr_value == LLDB_INVALID_ADDRESS)
return false;
size_t ptr_size = process_sp->GetAddressByteSize();
lldb::addr_t code_location = ptr_value + 2 * ptr_size;
lldb::addr_t domain_location = ptr_value + 3 * ptr_size;
Error error;
uint64_t code = process_sp->ReadUnsignedIntegerFromMemory(code_location, ptr_size, 0, error);
if (error.Fail())
return false;
lldb::addr_t domain_str_value = process_sp->ReadPointerFromMemory(domain_location, error);
if (error.Fail() || domain_str_value == LLDB_INVALID_ADDRESS)
return false;
if (!domain_str_value)
{
stream.Printf("domain: nil - code: %" PRIu64, code);
return true;
}
InferiorSizedWord isw(domain_str_value, *process_sp);
ValueObjectSP domain_str_sp = ValueObject::CreateValueObjectFromData("domain_str", isw.GetAsData(process_sp->GetByteOrder()), valobj.GetExecutionContextRef(), process_sp->GetTarget().GetScratchClangASTContext()->GetBasicType(lldb::eBasicTypeVoid).GetPointerType());
if (!domain_str_sp)
return false;
StreamString domain_str_summary;
if (NSStringSummaryProvider(*domain_str_sp, domain_str_summary, options) && !domain_str_summary.Empty())
{
stream.Printf("domain: %s - code: %" PRIu64, domain_str_summary.GetData(), code);
return true;
}
else
{
stream.Printf("domain: nil - code: %" PRIu64, code);
return true;
}
}
开发者ID:2asoft,项目名称:freebsd,代码行数:59,代码来源:NSError.cpp
示例14: options
bool
lldb_private::formatters::WCharStringSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions&)
{
ProcessSP process_sp = valobj.GetProcessSP();
if (!process_sp)
return false;
lldb::addr_t valobj_addr = GetArrayAddressOrPointerValue(valobj);
if (valobj_addr == 0 || valobj_addr == LLDB_INVALID_ADDRESS)
return false;
// Get a wchar_t basic type from the current type system
CompilerType wchar_compiler_type = valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeWChar);
if (!wchar_compiler_type)
return false;
const uint32_t wchar_size = wchar_compiler_type.GetBitSize(nullptr); // Safe to pass NULL for exe_scope here
StringPrinter::ReadStringAndDumpToStreamOptions options(valobj);
options.SetLocation(valobj_addr);
options.SetProcessSP(process_sp);
options.SetStream(&stream);
options.SetPrefixToken("L");
switch (wchar_size)
{
case 8:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF8>(options);
case 16:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF16>(options);
case 32:
return StringPrinter::ReadStringAndDumpToStream<StringPrinter::StringElementType::UTF32>(options);
default:
stream.Printf("size for wchar_t is not valid");
return true;
}
return true;
}
开发者ID:2asoft,项目名称:freebsd,代码行数:39,代码来源:CxxStringTypes.cpp
示例15: UpdateValueIfNeeded
lldb::ValueObjectSP
ValueObjectSynthetic::GetChildAtIndex (size_t idx, bool can_create)
{
UpdateValueIfNeeded();
ValueObject *valobj;
if (m_children_byindex.GetValueForKey(idx, valobj) == false)
{
if (can_create && m_synth_filter_ap.get() != NULL)
{
lldb::ValueObjectSP synth_guy = m_synth_filter_ap->GetChildAtIndex (idx);
if (!synth_guy)
return synth_guy;
m_children_byindex.SetValueForKey(idx, synth_guy.get());
return synth_guy;
}
else
return lldb::ValueObjectSP();
}
else
return valobj->GetSP();
}
开发者ID:fengsi,项目名称:freebsd,代码行数:22,代码来源:ValueObjectSyntheticFilter.cpp
示例16: exe_ctx
ObjCLanguageRuntime::ClassDescriptorSP
ObjCLanguageRuntime::GetClassDescriptor(ValueObject &valobj) {
ClassDescriptorSP objc_class_sp;
// if we get an invalid VO (which might still happen when playing around
// with pointers returned by the expression parser, don't consider this
// a valid ObjC object)
if (valobj.GetCompilerType().IsValid()) {
addr_t isa_pointer = valobj.GetPointerValue();
if (isa_pointer != LLDB_INVALID_ADDRESS) {
ExecutionContext exe_ctx(valobj.GetExecutionContextRef());
Process *process = exe_ctx.GetProcessPtr();
if (process) {
Error error;
ObjCISA isa = process->ReadPointerFromMemory(isa_pointer, error);
if (isa != LLDB_INVALID_ADDRESS)
objc_class_sp = GetClassDescriptorFromISA(isa);
}
}
}
return objc_class_sp;
}
开发者ID:CodaFi,项目名称:swift-lldb,代码行数:22,代码来源:ObjCLanguageRuntime.cpp
示例17: static_type
TypeAndOrName
JavaLanguageRuntime::FixUpDynamicType(const TypeAndOrName &type_and_or_name,
ValueObject &static_value) {
CompilerType static_type(static_value.GetCompilerType());
TypeAndOrName ret(type_and_or_name);
if (type_and_or_name.HasType()) {
CompilerType orig_type = type_and_or_name.GetCompilerType();
if (static_type.IsReferenceType())
ret.SetCompilerType(orig_type.GetLValueReferenceType());
}
return ret;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:13,代码来源:JavaLanguageRuntime.cpp
示例18: g___a_
bool lldb_private::formatters::LibCxxAtomicSummaryProvider(
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
static ConstString g___a_("__a_");
if (ValueObjectSP child = valobj.GetChildMemberWithName(g___a_, true)) {
std::string summary;
if (child->GetSummaryAsCString(summary, options) && summary.size() > 0) {
stream.Printf("%s", summary.c_str());
return true;
}
}
return false;
}
开发者ID:krytarowski,项目名称:lldb,代码行数:14,代码来源:LibCxxAtomic.cpp
示例19: buffer
bool
lldb_private::formatters::CFAbsoluteTimeSummaryProvider (ValueObject& valobj, Stream& stream)
{
time_t epoch = GetOSXEpoch();
epoch = epoch + (time_t)valobj.GetValueAsUnsigned(0);
tm *tm_date = localtime(&epoch);
if (!tm_date)
return false;
std::string buffer(1024,0);
if (strftime (&buffer[0], 1023, "%Z", tm_date) == 0)
return false;
stream.Printf("%04d-%02d-%02d %02d:%02d:%02d %s", tm_date->tm_year+1900, tm_date->tm_mon+1, tm_date->tm_mday, tm_date->tm_hour, tm_date->tm_min, tm_date->tm_sec, buffer.c_str());
return true;
}
开发者ID:VanirLLVM,项目名称:toolchain_lldb,代码行数:14,代码来源:CF.cpp
示例20: exe_ctx
lldb::ValueObjectSP
lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,
const char* return_type,
const char* selector,
const char* key)
{
lldb::ValueObjectSP valobj_sp;
if (!return_type || !*return_type)
return valobj_sp;
if (!selector || !*selector)
return valobj_sp;
if (!key || !*key)
return valobj_sp;
StreamString expr_path_stream;
valobj.GetExpressionPath(expr_path_stream, false);
StreamString expr;
expr.Printf("(%s)[%s %s:%s]",return_type,expr_path_stream.GetData(),selector,key);
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
lldb::ValueObjectSP result_sp;
Target* target = exe_ctx.GetTargetPtr();
StackFrame* stack_frame = GetViableFrame(exe_ctx);
if (!target || !stack_frame)
return valobj_sp;
EvaluateExpressionOptions options;
options.SetCoerceToId(false);
options.SetUnwindOnError(true);
options.SetKeepInMemory(true);
options.SetUseDynamic(lldb::eDynamicCanRunTarget);
target->EvaluateExpression(expr.GetData(),
stack_frame,
valobj_sp,
options);
return valobj_sp;
}
开发者ID:gnuhub,项目名称:lldb,代码行数:36,代码来源:CXXFormatterFunctions.cpp
注:本文中的ValueObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论