Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PString::PString ( const char *  cstr,
PINDEX  len 
)

Create a string from the array. A new memory block is allocated of a size equal to len# plus one which is sufficient to take the string and a terminating '' character.

If UCS-2 is used then each char from the char pointer is mapped to a single UCS-2 character.

Note that this function will allow a string with embedded '' characters to be created, but most of the functions here will be unable to access characters beyond the first ''. Furthermore, if the MakeMinimumSize()# function is called, all data beyond that first #''# character will be lost.

Parameters:
cstr  Pointer to a string of characters.
len  Length of the string in bytes.

Definition at line 1265 of file contain.cxx.

  : PCharArray(len+1)
{
  if (len > 0)
    memcpy(theArray, PAssertNULL(cstr), len);
}


Generated by  Doxygen 1.6.0   Back to index