CXXR (C++ R)
Public Member Functions | Static Public Member Functions | Friends

CXXR::CachedString Class Reference

String object held in a cache. More...

#include <CachedString.h>

Inheritance diagram for CXXR::CachedString:
Inheritance graph
[legend]
Collaboration diagram for CXXR::CachedString:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const std::string & stdstring () const
 Access encapsulated std::string.
const char * typeName () const
 Name within R of this type of object.

Static Public Member Functions

static CachedStringblank ()
 Blank string.
static CachedStringobtain (const std::string &str, cetype_t encoding=CE_NATIVE)
 Get a pointer to a CachedString object.
static const char * staticTypeName ()
 The name by which this type is known in R.

Friends

class SchwarzCounter< CachedString >
class Symbol

Detailed Description

String object held in a cache.

At any one time, at most one CachedString object with a particular text and encoding may exist.


Member Function Documentation

static CachedString* CXXR::CachedString::blank ( ) [inline, static]

Blank string.

Returns:
const pointer to the string "".
CachedString * CachedString::obtain ( const std::string &  str,
cetype_t  encoding = CE_NATIVE 
) [static]

Get a pointer to a CachedString object.

If no CachedString with the specified text and encoding currently exists, one will be created, and a pointer to it returned. Otherwise a pointer to the existing CachedString will be returned.

Parameters:
strThe text of the required CachedString. (Embedded null characters are permissible.)
encodingThe encoding of the required CachedString. Only CE_NATIVE, CE_UTF8 or CE_LATIN1 are permitted in this context (checked). Note that if str contains no non-ASCII characters, then the encoding is set to CE_NATIVE regardless of the value of the encoding parameter.
Returns:
Pointer to a CachedString (preexisting or newly created) representing the specified text in the specified encoding.
static const char* CXXR::CachedString::staticTypeName ( ) [inline, static]

The name by which this type is known in R.

Returns:
the name by which this type is known in R.

Reimplemented from CXXR::String.

const std::string& CXXR::CachedString::stdstring ( ) const [inline]

Access encapsulated std::string.

Returns:
Reference to the encapsulated std::string.
const char * CachedString::typeName ( ) const [virtual]

Name within R of this type of object.

Returns:
the name by which this type of object is known within R.

Reimplemented from CXXR::RObject.


The documentation for this class was generated from the following files: