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

void PString::Delete ( PINDEX  start,
PINDEX  len 
) [inherited]

Remove the substring from the string.

Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.

Parameters:
start  Position in string to remove.
len  Number of characters to delete.

Definition at line 1772 of file contain.cxx.

References PString::GetLength(), PString::MakeMinimumSize(), and PString::MakeUnique().

Referenced by PFile::GetInfo(), PDynaLink::GetName(), PURL::InternalParse(), and PURL::UntranslateString().

{
  if (start < 0 || len < 0)
    return;

  MakeUnique();

  register PINDEX slen = GetLength();
  if (start > slen)
    return;

  if (len > slen - start)
    SetAt(start, '\0');
  else
    memmove(theArray+start, theArray+start+len, slen-start-len+1);
  MakeMinimumSize();
}


Generated by  Doxygen 1.6.0   Back to index