osgEarth 2.1.1
Public Types | Public Member Functions | Private Member Functions | Private Attributes

osgEarth::Json::Value::CZString Class Reference

List of all members.

Public Types

enum  DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }

Public Member Functions

 CZString (int index)
 CZString (const char *cstr, DuplicationPolicy allocate)
 CZString (const CZString &other)
 ~CZString ()
CZStringoperator= (const CZString &other)
bool operator< (const CZString &other) const
bool operator== (const CZString &other) const
int index () const
const char * c_str () const
bool isStaticString () const

Private Member Functions

void swap (CZString &other)

Private Attributes

const char * cstr_
int index_

Detailed Description

Definition at line 191 of file JsonUtils.


Member Enumeration Documentation

Enumerator:
noDuplication 
duplicate 
duplicateOnCopy 

Definition at line 194 of file JsonUtils.


Constructor & Destructor Documentation

Value::CZString::CZString ( int  index)

Definition at line 435 of file JsonUtils.cpp.

   : cstr_( 0 )
   , index_( index )
{
}
Value::CZString::CZString ( const char *  cstr,
DuplicationPolicy  allocate 
)

Definition at line 441 of file JsonUtils.cpp.

   : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) 
                                  : cstr )
   , index_( allocate )
{
}
Value::CZString::CZString ( const CZString other)

Definition at line 448 of file JsonUtils.cpp.

: cstr_( other.index_ != noDuplication &&  other.cstr_ != 0
                ?  valueAllocator()->makeMemberName( other.cstr_ )
                : other.cstr_ )
   , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate)
                         : other.index_ )
{
}
Value::CZString::~CZString ( )

Definition at line 457 of file JsonUtils.cpp.

{
   if ( cstr_  &&  index_ == duplicate )
      valueAllocator()->releaseMemberName( const_cast<char *>( cstr_ ) );
}

Here is the call graph for this function:


Member Function Documentation

const char * Value::CZString::c_str ( ) const

Definition at line 503 of file JsonUtils.cpp.

{
   return cstr_;
}

Here is the caller graph for this function:

int Value::CZString::index ( ) const

Definition at line 496 of file JsonUtils.cpp.

{
   return index_;
}

Here is the caller graph for this function:

bool Value::CZString::isStaticString ( ) const

Definition at line 509 of file JsonUtils.cpp.

{
   return index_ == noDuplication;
}

Here is the caller graph for this function:

bool Value::CZString::operator< ( const CZString other) const

Definition at line 479 of file JsonUtils.cpp.

{
   if ( cstr_ )
      return strcmp( cstr_, other.cstr_ ) < 0;
   return index_ < other.index_;
}
Value::CZString & Value::CZString::operator= ( const CZString other)

Definition at line 471 of file JsonUtils.cpp.

{
   CZString temp( other );
   swap( temp );
   return *this;
}

Here is the call graph for this function:

bool Value::CZString::operator== ( const CZString other) const

Definition at line 487 of file JsonUtils.cpp.

{
   if ( cstr_ )
      return strcmp( cstr_, other.cstr_ ) == 0;
   return index_ == other.index_;
}
void Value::CZString::swap ( CZString other) [private]

Definition at line 464 of file JsonUtils.cpp.

{
   std::swap( cstr_, other.cstr_ );
   std::swap( index_, other.index_ );
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 212 of file JsonUtils.

Definition at line 213 of file JsonUtils.


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