MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetStringAttribute

Function GetStringAttribute

trinity/Tr2DynamicBinding.cpp:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool GetStringAttribute( IRoot* object, const std::string& name, std::string& value )
56{
57 auto entry = FindEntry( object, name.c_str() );
58 if( !entry.second )
59 {
60 return false;
61 }
62 switch( entry.first->mType )
63 {
64 case Be::CHARARRAY:
65 value = reinterpret_cast<const char*>( entry.second );
66 return true;
67 case Be::CSTRING:
68 value = reinterpret_cast<const char*>( entry.second->mCharPtr );
69 return true;
70 case Be::STDSTRING:
71 value = *reinterpret_cast<const std::string*>( entry.second );
72 return true;
73 case Be::SHAREDSTRING:
74 value = reinterpret_cast<BlueSharedString*>( entry.second )->c_str();
75 return true;
76 default:
77 return false;
78 }
79}
80
81IRoot* GetListElement( IRoot* object, ssize_t index )
82{

Callers 1

GetListElementFunction · 0.70

Calls 1

FindEntryFunction · 0.70

Tested by

no test coverage detected