| 53 | } |
| 54 | |
| 55 | bool 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 | |
| 81 | IRoot* GetListElement( IRoot* object, ssize_t index ) |
| 82 | { |
no test coverage detected