osgEarth 2.1.1
Public Member Functions

osgEarth::Json::DefaultValueAllocator Class Reference

Inheritance diagram for osgEarth::Json::DefaultValueAllocator:
Collaboration diagram for osgEarth::Json::DefaultValueAllocator:

List of all members.

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)

Detailed Description

Definition at line 58 of file JsonUtils.cpp.


Constructor & Destructor Documentation

virtual osgEarth::Json::DefaultValueAllocator::~DefaultValueAllocator ( ) [inline, virtual]

Definition at line 61 of file JsonUtils.cpp.

   {
   }

Member Function Documentation

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 );
   }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines