--------------------------------------------------------------------- CLASS: String --JD/DVM PUBLIC METHODS: String() - Constructor: empty string String(s) - Constructor: makes copy from CHAR_PTR String(bp,l) - Constructor: from BYTE_PTR , len operator==() - comparison (Inherited from RWCString) operator=() - assign from String or CHAR_PTR (Inherited from RWCString) CHAR_PTR() - casts to CHAR_PTR or CONST_CHAR_PTR (Inherited frm RWCString) remove() - truncates (Inherited from RWCString) toMem() - copies to region of memory toMemArea() - toMem with limited length. toMemOCU() - toMem with OSTA Compressed Unicode length() - strlen() equivalent (Inherited from RWCString) * * * - all other RWCString methods USAGE NOTES: String Constructors (void) - empty string of length 0 (CONST_CHAR_PTR) - from c strings (null terminated) (BYTE_PTR rbp, len) - takes len chars starting at rbp (BYTE_PTR rbp, len, type) - as above, with ASCII or OCU (String &s) - copy constructor, to allow passing as arg, return value, etc. String Method Overview Operator support for String: == (comparison - between two strings) = (assignment - from String or CHAR_PTR) () (casting - to CHAR_PTR, CONST_CHAR_PTR) Special member functions: remove(max) - This truncates the string to the supplied length toMem(CHAR_PTR s) - This copies its contents to the supplied memory location. toMemArea() - above to location with limits on length toMemOCU() - above but prepending 0x08 (OSTA Compressed Unicode) length() - Returns the length of the string. Special considerations: If a String is assigned or promoted to a CHAR_PTR, it will use the CHAR_PTR casting operator. This returns the address of the characters, and is suitable for sending to a printf() call, for example. However, if the String may go out of scope, a copy of the string is needed, so the toMem() method should be used. ---------------------------------------------------------------------- --------------------------------------------------------------------- METHOD: String::toMemArea() --DVM Copies string to memory, at supplied address with limited len. This method should fill out memLen bytes with the contents of the string. If memLen is larger than the string length, all unused bytes will be set to zero. Otherwise, no null termination will be supplied. ARGS: BYTE_PTR s IN Destination location UINT16 memLen IN Max bytes available RETURNS: NONE PRE-CONDITIONS: memLen bytes available at destination. POST-CONDITIONS: none. ERRORS: NONE. NOTES: Uses memcpy() library call. ---------------------------------------------------------------------- NSR::String::String( CONST_CHAR_PTR s ) NSR::String::String( CONST_BYTE_PTR s, UINT16 maxLen, CharSetType cst ) NSR::String::String( CONST_BYTE_PTR s, UINT16 maxLen, CharSetType cst ) : RWCString((CONST_CHAR_PTR) s,maxLen) --------------------------------------------------------------------- METHOD: String::toMemArea() --DVM Copies string to memory, at supplied address with limited len. This method should fill out memLen bytes with the contents of the string. If memLen is larger than the string length, all unused bytes will be set to zero. Otherwise, no null termination will be supplied. ARGS: BYTE_PTR s IN Destination location UINT16 memLen IN Max bytes available RETURNS: NONE PRE-CONDITIONS: memLen bytes available at destination. POST-CONDITIONS: none. ERRORS: NONE. NOTES: Uses memcpy() library call. ---------------------------------------------------------------------- void NSR::String::toMem( CHAR_PTR s ) const void NSR::String::toMem( CHAR_PTR s ) const void NSR::SmallByteArray::toMem( BYTE_PTR b ) const void NSR::ByteArray::toMem( BYTE_PTR b ) const NSR::Boolean NSR::ByteArrayRef::toMem( BYTE_PTR buf ) const NSR::Boolean NSR::ByteArrayRef::toMem( BYTE_PTR buf ) const --------------------------------------------------------------------- METHOD: String::toMemArea() --DVM Copies string to memory, at supplied address with limited len. This method should fill out memLen bytes with the contents of the string. If memLen is larger than the string length, all unused bytes will be set to zero. Otherwise, no null termination will be supplied. ARGS: BYTE_PTR s IN Destination location UINT16 memLen IN Max bytes available RETURNS: NONE PRE-CONDITIONS: memLen bytes available at destination. POST-CONDITIONS: none. ERRORS: NONE. NOTES: Uses memcpy() library call. ---------------------------------------------------------------------- void NSR::String::toMemArea( BYTE_PTR s, UINT16 memLen ) const void NSR::String::toMemArea( BYTE_PTR s, UINT16 memLen ) const --------------------------------------------------------------------- METHOD: String::toMemOCU() --DVM Copies string, converting to OSTA Compressed Unicode to memory. This method should fill out memLen bytes with the contents of the string. If memLen is larger than the string length, all unused bytes will be set to zero. Otherwise, no null termination will be supplied. The first byte will be set to an 0x08, to indicate 8-bit compression. ARGS: BYTE_PTR s IN Destination location UINT16 memLen IN Max bytes available RETURNS: NONE PRE-CONDITIONS: memLen bytes available at destination. POST-CONDITIONS: none. ERRORS: NONE. NOTES: Uses memcpy() library call. ---------------------------------------------------------------------- void NSR::String::toMemOCU( BYTE_PTR s, UINT16 memLen ) const void NSR::String::toMemOCU( BYTE_PTR s, UINT16 memLen ) const