JNIpp 1.0
JNI meets C++
java::String Class Reference

Wrapper for java.lang.String. More...

Inheritance diagram for java::String:
java::CharSequence java::Object jni::AbstractObject

List of all members.

Public Member Functions

 String ()
 Creates empty java.lang.String and wraps it.
 String (const char *string)
 Creates java.lang.String from string and wraps it.
 String (const jchar *string)
 Creates java.lang.String from string and wraps it.
 String (const jchar *string, jint length)
 Creates java.lang.String from string of the specified length and wraps it.
 String (const jni::LObject &string)
 Wraps string.
jint GetLength () const
 Returns number of unicode characters in the string.
const jchar * Get () const
 Returns unicode characters of the string.
jint GetUTFLength () const
 Returns number of bytes in UTF representation of the string.
const char * GetUTF () const
 Returns UTF version of the string.

Detailed Description

Wrapper for java.lang.String.


Member Function Documentation

const jchar* java::String::Get ( ) const

Returns unicode characters of the string.

The value is cached, so you can safely call this method multiple times.

jint java::String::GetLength ( ) const

Returns number of unicode characters in the string.

The value is NOT cached, jni function is called each time.

Reimplemented from java::CharSequence.

const char* java::String::GetUTF ( ) const

Returns UTF version of the string.

The value is cached, so you can safely call this method multiple times.

jint java::String::GetUTFLength ( ) const

Returns number of bytes in UTF representation of the string.

To get number of characters in the string use GetLength().