osgEarth 2.1.1
|
Public Member Functions | |
virtual | ~DefaultValueAllocator () |
virtual char * | makeMemberName (const char *memberName) |
virtual void | releaseMemberName (char *memberName) |
virtual char * | duplicateStringValue (const char *value, unsigned int length=unknown) |
virtual void | releaseStringValue (char *value) |
Definition at line 58 of file JsonUtils.cpp.
virtual osgEarth::Json::DefaultValueAllocator::~DefaultValueAllocator | ( | ) | [inline, virtual] |
Definition at line 61 of file JsonUtils.cpp.
{ }
virtual char* osgEarth::Json::DefaultValueAllocator::duplicateStringValue | ( | const char * | value, |
unsigned int | length = unknown |
||
) | [inline, virtual] |
Implements osgEarth::Json::ValueAllocator.
Definition at line 75 of file JsonUtils.cpp.
{ //@todo invesgate this old optimization //if ( !value || value[0] == 0 ) // return 0; if ( length == unknown ) length = (unsigned int)strlen(value); char *newString = static_cast<char *>( malloc( length + 1 ) ); memcpy( newString, value, length ); newString[length] = 0; return newString; }
virtual char* osgEarth::Json::DefaultValueAllocator::makeMemberName | ( | const char * | memberName | ) | [inline, virtual] |
Implements osgEarth::Json::ValueAllocator.
Definition at line 65 of file JsonUtils.cpp.
{ return duplicateStringValue( memberName ); }
virtual void osgEarth::Json::DefaultValueAllocator::releaseMemberName | ( | char * | memberName | ) | [inline, virtual] |
Implements osgEarth::Json::ValueAllocator.
Definition at line 70 of file JsonUtils.cpp.
{ releaseStringValue( memberName ); }
virtual void osgEarth::Json::DefaultValueAllocator::releaseStringValue | ( | char * | value | ) | [inline, virtual] |
Implements osgEarth::Json::ValueAllocator.
Definition at line 90 of file JsonUtils.cpp.
{
if ( value )
free( value );
}