SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform
Class String::LatinCharBuffer

NonCopyableType
   |
   +-LatinCharBuffer

Implemented in:
Platform.String.h
Enclosing class:
String

class LatinCharBuffer:
private NonCopyableType

A LatinCharBuffer allows to convert a String into a null terminated sequence of LatinChar characters. The internally allocated buffer is released once the buffer object goes out of scope. This is useful for converting Unicode strings into native C strings when passing to native system calls which do not accept Unicode string arguments.

For example the following code will pass a string to a system call:
    String name = appText("filename.txt");
    String::LatinCharBuffer buffer(name);
    NativeAPI::open(+buffer, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO);
See Also:
appStringToNative

Constructor Summarycollapse
LatinCharBuffer(const String& inString)
          Creates a buffer of LatinChar type characters and copies into it the character seqence of a given string.
~LatinCharBuffer()
          Destructor.

Method Summarycollapse
Int length() const
          Retrieves the number of characters in this buffer.
const LatinChar* operator+() const
          Retrieves the pointer to the character sequence of this buffer.
Int size() const
          Retrieves the size in bytes of this buffer.
LatinChar* value()
          Retrieves the pointer to the character sequence of this buffer.
const LatinChar* value() const
          Retrieves the pointer to the character sequence of this buffer.

 

Constructor Detail

LatinCharBuffer[inline]

LatinCharBuffer(const String& inString)

Creates a buffer of LatinChar type characters and copies into it the character seqence of a given string.

Parameters:
inString - a string to convert to LatinChar type characters

~LatinCharBuffer[inline]

~LatinCharBuffer()

Destructor. Deallocates the previously allocated buffer.

 

Method Detail

length[inline]

Int length() const

Retrieves the number of characters in this buffer.

Returns:
the number of characters in this buffer

operator+[inline]

const LatinChar* operator+() const

Retrieves the pointer to the character sequence of this buffer.

Returns:
pointer to the character sequence

size[inline]

Int size() const

Retrieves the size in bytes of this buffer.

Returns:
the size in bytes of this buffer

value[inline]

LatinChar* value()

Retrieves the pointer to the character sequence of this buffer.

Returns:
pointer to the character sequence

value[inline]

const LatinChar* value() const

Retrieves the pointer to the character sequence of this buffer.

Returns:
pointer to the character sequence


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND