Codemesh Runtime v3 C++ API Reference
3.9.205
|
A mixin or utility class for Java string features. More...
#include <xmog_java_string.h>
Static Public Member Functions | |
static void | init_encodings (xmog_localenv *env=NULL) |
Initializes the static instances. More... | |
static void | set_default_encoding (const char *_enc, xmog_localenv *env=NULL) |
Sets the default encoding that is used on the current thread. More... | |
static void | set_default_encoding (const XMOG_WCHAR *_enc, xmog_localenv *env=NULL) |
Sets the default encoding that is used on the current thread. More... | |
static void | set_default_encoding (xmog_base *_enc, xmog_localenv *env=NULL) |
Sets the default encoding that is used on the current thread. More... | |
static jstring | from_char (const char *_str, jint _len=-1, xmog_base *_enc=NULL, xmog_localenv *env=NULL, xmog_base *pStr=NULL, char **pCache=NULL) |
Returns a jstring for the given character string. More... | |
static void | from_char (xmog_base *_this, xmog_flags _flags, const char *_str, jint _len=-1, xmog_base *_enc=NULL, xmog_localenv *env=NULL, xmog_base *pStr=NULL, char **pCache=NULL) |
Returns a jstring for the given character string. More... | |
static jstring | from_charUtf8 (const char *_strUTF, xmog_localenv *env=NULL) |
Returns a jstring for the given UTF-8 character string. More... | |
static void | from_charUtf8 (xmog_base *_this, xmog_flags _flags, const char *_strUTF, xmog_localenv *env=NULL) |
Returns a jstring for the given UTF-8 character string. More... | |
static char * | to_char (jstring _str, xmog_localenv *env=NULL, xmog_base *pStr=NULL, char **pCache=NULL) |
Returns a char string for the given Java string. More... | |
static char * | to_char (jstring _str, xmog_base *_enc, xmog_localenv *env=NULL, xmog_base *pStr=NULL, char **pCache=NULL) |
Returns a char string for the given Java string. More... | |
static char * | to_charUtf8 (jstring _str, xmog_localenv *env=NULL, xmog_base *pStr=NULL, char **pCache=NULL) |
Returns a UTF-8 string for the given Java string. More... | |
static unsigned short * | to_u16 (jstring _str, xmog_localenv *env=NULL) |
Returns a unsigned short string for the given Java string. More... | |
static void | free (char *&str) |
Frees a previously allocated string. More... | |
static void | free_u16 (unsigned short *&str) |
Frees a previously allocated string. More... | |
Static Public Attributes | |
static xmog_base * | US_ASCII |
The US-ASCII character set. | |
static xmog_base * | ISO_8859_1 |
The ISO-8859-1 character set. | |
static xmog_base * | UTF_8 |
The UTF-8 character set. | |
static xmog_base * | UTF_16BE |
The UTF-16BE character set. | |
static xmog_base * | UTF_16LE |
The UTF-16LE character set. | |
static xmog_base * | UTF_16 |
The UTF-16 character set. | |
A mixin or utility class for Java string features.
This class provides different variations of the same API to allow use from singlebyte and multibyte (UNICODE) clients. It also declares several static encoding instances that can be used to support the built-in encodings.
|
static |
Frees a previously allocated string.
This method relies on the fact that the string that is to be freed was previously allocated using the framework's memory allocator.
|
static |
Frees a previously allocated string.
This method relies on the fact that the string that is to be freed was previously allocated using the framework's memory allocator.
|
static |
Returns a jstring
for the given character string.
_str | the native string to convert to a jstring . |
_len | the optional length to use. If different from -1, specifies the number of characters to use. If -1, assume a zero-terminated string and calculate its length. |
_enc | the encoding to use. May be NULL , in which case the default encoding is used. |
env | the local calling context. May be NULL . |
pStr | the optional pointer to the proxy instance. May be NULL . |
pCache | the optional pointer to the caching pointer. May be NULL . |
|
static |
Returns a jstring
for the given character string.
_this | the instance into which the jstring instance is set. |
_flags | the bitflags containing the reference type. |
_str | the native string to convert to a jstring . |
_len | the optional length to use. If different from -1, specifies the number of characters to use. If -1, assume a zero-terminated string and calculate its length. |
_enc | the encoding to use. May be NULL , in which case the default encoding is used. |
env | the local calling context. May be NULL . |
pStr | the optional pointer to the proxy instance. May be NULL . |
pCache | the optional pointer to the caching pointer. May be NULL . |
|
static |
Returns a jstring
for the given UTF-8 character string.
_strUTF | the UTF-8 string to convert to a jstring . |
env | the local calling context. May be NULL . |
|
static |
Returns a jstring
for the given UTF-8 character string.
_this | the instance into which the jstring instance is set. |
_flags | the bitflags containing the reference type. |
_strUTF | the UTF-8 string to convert to a jstring . |
env | the local calling context. May be NULL . |
|
static |
Initializes the static instances.
This method is called internally by the xmog_java_string class and by the xmog_jvm class when the JVM is loaded.
|
static |
Sets the default encoding that is used on the current thread.
An encoding is always thread-specific to support servers that have to run threads on behalf of more than one user.
_enc | the name of the default encoding to use on the current thread. |
env | the local calling context. May be NULL . |
|
static |
Sets the default encoding that is used on the current thread.
An encoding is always thread-specific to support servers that have to run threads on behalf of more than one user.
_enc | the name of the default encoding to use on the current thread. |
env | the local calling context. May be NULL . |
|
static |
Sets the default encoding that is used on the current thread.
An encoding is always thread-specific to support servers that have to run threads on behalf of more than one user.
_enc | the default encoding to use on the current thread. |
env | the local calling context. May be NULL . |
|
static |
Returns a char
string for the given Java string.
_str | the Java string handle. |
_enc | the encoding used for the character extraction. May be NULL . |
env | the local calling context. May be NULL . |
pStr | the optional pointer to the proxy instance. May be NULL . |
pCache | the optional pointer to the caching pointer. May be NULL . |
char
string that was allocated using xmog_util::setString(char*&,const char*). It should be deallocated using xmog_util::setString( char*& , NULL );
|
static |
Returns a char
string for the given Java string.
_str | the Java string handle. |
env | the local calling context. May be NULL . |
pStr | the optional pointer to the proxy instance. May be NULL . |
pCache | the optional pointer to the caching pointer. May be NULL . |
char
string that was allocated using xmog_util::setString(char*&,const char*). It should be deallocated using xmog_util::setString( char*& , NULL );
|
static |
Returns a UTF-8 string for the given Java string.
_str | the Java string handle. |
env | the local calling context. May be NULL . |
pStr | the optional pointer to the proxy instance. May be NULL . |
pCache | the optional pointer to the caching pointer. May be NULL . |
char
string that was allocated using xmog_util::setString(char*&,const char*). It should be deallocated using xmog_util::setString( char*& , NULL );
|
static |
Returns a unsigned
short
string for the given Java string.
_str | the Java string handle. |
env | the local calling context. May be NULL . |
wchar_t
string that was allocated using xmog_util::setString(wchar_t*&,const wchar_t*). It should be deallocated using xmog_util::setString( wchar_t*& , NULL );