CXXR (C++ R) API
Classes | Namespaces | Functions
CachedString.h File Reference

($Id: CachedString.h 1275 2012-03-17 14:01:29Z arr $)

Class CXXR::CachedString and associated C interface. More...

#include "CXXR/String.h"
#include <tr1/unordered_map>
#include <string>
#include "CXXR/Allocator.hpp"
#include "CXXR/SchwarzCounter.hpp"
Include dependency graph for CachedString.h:

Go to the source code of this file.

Classes

class  CXXR::CachedString
 String object held in a cache. More...

Namespaces

namespace  CXXR
 Namespace for the CXXR project.

Functions

int IS_CACHED (SEXP x)
 Is a String cached?
SEXP Rf_mkChar (const char *str)
 Get a pointer to a cached ASCII string object.
SEXP Rf_mkCharCE (const char *str, cetype_t encoding)
 Get a pointer to a cached string object.
SEXP Rf_mkCharLenCE (const char *text, int length, cetype_t encoding)
 Create a CXXR::UncachedString object for specified text and encoding.
SEXP Rf_mkCharLen (const char *text, int length)
 Create a CXXR::UncachedString object for specified text.

Detailed Description

Class CXXR::CachedString and associated C interface.


Function Documentation

int IS_CACHED ( SEXP  x)
inline

Is a String cached?

Parameters:
xPointer to a CXXR::String.
Returns:
a non-zero value iff x points to a CachedString.
SEXP Rf_mkChar ( const char *  str)
inline

Get a pointer to a cached ASCII string object.

If no cached string with the specified text currently exists, one will be created. Otherwise a pointer to the existing cached string will be returned.

Parameters:
strThe text of the required cached string.
Returns:
Pointer to a string object representing the specified text.
SEXP Rf_mkCharCE ( const char *  str,
cetype_t  encoding 
)
inline

Get a pointer to a cached string object.

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

Parameters:
strThe text of the required cached string.
encodingThe encoding of the required CachedString. Only CE_NATIVE, CE_UTF8 or CE_LATIN1 are permitted in this context (checked).
Returns:
Pointer to a string object representing the specified text in the specified encoding.
SEXP Rf_mkCharLen ( const char *  text,
int  length 
)
inline

Create a CXXR::UncachedString object for specified text.

Parameters:
textThe text of the string to be created, possibly including embedded null characters. The encoding is assumed to be CE_NATIVE.
lengthThe length of the string pointed to by text. Must be nonnegative. The created string will comprise the text plus an appended null byte.
Returns:
Pointer to the created string.
SEXP Rf_mkCharLenCE ( const char *  text,
int  length,
cetype_t  encoding 
)

Create a CXXR::UncachedString object for specified text and encoding.

Parameters:
textThe text of the string to be created, possibly including embedded null characters. The encoding is assumed to be CE_NATIVE.
lengthThe length of the string pointed to by text. Must be nonnegative. The created string will comprise the text plus an appended null byte.
encodingThe encoding of the required CachedString. Only CE_NATIVE, CE_UTF8 or CE_LATIN1 are permitted in this context (checked).
Returns:
Pointer to the created string.