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

LispString Class Reference

Inheritance diagram for LispString:

CArrayGrower< LispChar > RefCountedObjectBase CArrayGrowerBase

List of all members.

Detailed Description

string. Also keeps a reference count for any one interested. LispString is derived from CArrayGrower, so the function NrItems returns the length of the buffer. Since the string is also zero-terminated (for better interfacing with the normal c functions), the string length is NrItems()-1.

This class also allows the string to point to a buffer which is owned by another part of the system, in which case it cannot be resized. The array will then not be freed by this class.

Definition at line 27 of file lispstring.h.

Public Types

typedef LispChar ElementType
typedef LispChar * ElementTypePtr

Public Member Functions

int Append (LispCharaValue)
 Append an element to an array.
LispBoolean ArrayOwnedExternally ()
int BaseAppend (LispChar *aValue)
void Clear ()
void CopyToExternalArray (LispChar *&aArray, LispBoolean aPreAlloc)
 Copy the array to another array.
ReferenceType DecreaseRefCount ()
void Delete (int aIndex, int aCount=1)
 Delete element(s) from the array.
void GrowTo (int aNrItems)
void IncreaseRefCount ()
void Insert (int aIndex, LispChar &aObj, LispInt aCount=1)
 Insert object aObj, aCount times.
LispChar & Item (const int aIndex) const
 LispString (LispCharPtr aString, LispBoolean aStringOwnedExternally=LispFalse)
 Construct from string.
 LispString (LispString &aString, LispBoolean aStringOwnedExternally=LispFalse)
 Construct from another string.
 LispString (LispBoolean aStringOwnedExternally=LispFalse)
void Move (int aSrcIndex, int aTrgIndex)
void MoveBlock (int aSrcIndex, int aTrgIndex)
LispInt NrAllocated ()
 Return the number of allocated cells.
int NrItems () const
 Return the number of items currently in the array.
void operator delete (void *object)
void operator delete[] (void *object)
void * operator new (size_t size)
void * operator new[] (size_t size)
LispStringoperator= (LispCharPtr aString)
LispInt operator== (const LispString &aString)
LispChar & operator[] (const int aIndex) const
 Access to an element in the array.
ReferenceType ReferenceCount () const
void SetExternalArray (LispChar *aArray, LispInt aNrItems)
void SetGranularity (LispInt aGranularity)
 Set the step size for growing the array.
void SetNrItems (int aNrItems)
void SetStringCounted (LispCharPtr aString, LispInt aLength)
void SetStringStringified (LispCharPtr aString)
void SetStringUnStringified (LispCharPtr aString)
LispCharPtr String () const
 String() returns the pointer to the first character.

Protected Member Functions

LispChar * BaseItem (int aIndex)

Protected Attributes

LispChar * iArray
LispBoolean iArrayOwnedExternally
LispInt iGranularity
LispInt iItemSize
LispInt iNrAllocated
LispInt iNrItems

Private Member Functions

void SetString (LispCharPtr aString, LispBoolean aStringOwnedExternally=LispFalse)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index