Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

SString Class Reference

#include <sstring.hpp>

Inheritance diagram for SString:

Inheritance graph
[legend]
Collaboration diagram for SString:

Collaboration graph
[legend]
List of all members.

Detailed Description

A container for a string.

SString class implements a string as an SReference to an SExpressionString object. Some useful operations are defined so that one can use the class instead of the standard string class.

Note:
the underlyng SExpressionString object is never changed. All the changes are implemented releazing the old object and creating a new one. This means the underlying strings can be shared without any doubt.

Definition at line 45 of file sstring.hpp.

Public Member Functions

 SString ()
 Make empty string.
 SString (const char *s)
 Make a string from a string literal.
 SString (SExpressionString *ts)
 Hold the given object.
 SString (const SString &other)
 The copy constructor.
 SString (const SReference &other)
 Type-checking construction from a reference.
 ~SString ()
 The destructor.
SStringoperator= (const char *s)
 Assign.
SString operator+ (const SString &other) const
 Concatenation.
void operator+= (const SString &other)
 Append another string.
SString operator+ (const char *s) const
 Concatenation.
void operator+= (const char *s)
 Append another string.
void operator+= (char c)
 Append a character.
const char * c_str () const
 Get a plain pointer to the string.
char operator[] (int index) const
 Get the element (char) by index.
unsigned int length () const
 Get the length of the string.
unsigned int Length () const
 Get the length of the string.
bool operator== (const SString &other) const
 String comparision.
bool operator!= (const SString &other) const
 String comparision.
Tp * GetPtr () const
 Get the appropriately typed pointer to the referenced object.
Tp & operator * () const
 Dereference (returns a reference to the pointe object).
Tp * operator-> () const
 Select a field/method of the referenced object.
SReferenceAddAnotherItemToList (const SReference &right)
 Add item to list.
SReferenceChangeListEnd (const SReference &new_last)
 Make/change dotted list.
SReference MakeCons (const SReference &right) const
 Make a cons.
SReferenceoperator, (const SReference &r)
 List composing operation.
SReferenceoperator|| (const SReference &t)
 dotted list composing operation
SReference operator^ (const SReference &t) const
 CONS operation.
bool operator== (const SReference &other) const
 Equality is just pointer comparision.
bool operator== (const SExpression *other) const
 Equality is just pointer comparision.
bool operator!= (const SReference &other) const
 Non-equality is just pointer comparision.
bool operator!= (const SExpression *other) const
 Non-equality is just pointer comparision.
bool IsEql (const SReference &other) const
bool IsEqual (const SReference &other) const
SReferenceCar () const
SReferenceCdr () const
SReferenceCCar () const
SReferenceCCdr () const
intelib_float_t GetFloat () const
intelib_integer_t GetInt () const
const char * GetString () const
char GetSingleChar () const
template<class Tp>
Tp * DynamicCastGetPtr () const
template<class Tp>
Tp * SimpleCastGetPtr () const
SReference Clone () const
SReference CopyList () const
SReference CopyTree () const
bool IsEmptyList () const


Constructor & Destructor Documentation

SString::SString  ) 
 

Make empty string.

Definition at line 48 of file sstring.hpp.

Referenced by IntelibGenericReader::FeedChar(), and operator+().

SString::SString const char *  s  ) 
 

Make a string from a string literal.

Definition at line 50 of file sstring.hpp.

SString::SString SExpressionString ts  ) 
 

Hold the given object.

Definition at line 52 of file sstring.hpp.

SString::SString const SString other  ) 
 

The copy constructor.

Definition at line 54 of file sstring.hpp.

SString::SString const SReference other  ) 
 

Type-checking construction from a reference.

Definition at line 56 of file sstring.hpp.

SString::~SString  ) 
 

The destructor.

Definition at line 58 of file sstring.hpp.


Member Function Documentation

SString & SString::operator= const char *  s  ) 
 

Assign.

Definition at line 40 of file sstring.cpp.

References SReference::operator=(), and SReference::SReference().

Referenced by operator+=().

SString SString::operator+ const SString other  )  const
 

Concatenation.

Definition at line 47 of file sstring.cpp.

References c_str(), and SString().

void SString::operator+= const SString other  ) 
 

Append another string.

Definition at line 52 of file sstring.cpp.

References c_str(), and operator=().

SString SString::operator+ const char *  s  )  const
 

Concatenation.

Definition at line 57 of file sstring.cpp.

References c_str(), and SString().

void SString::operator+= const char *  s  ) 
 

Append another string.

Definition at line 62 of file sstring.cpp.

References c_str(), and operator=().

void SString::operator+= char  c  ) 
 

Append a character.

Definition at line 67 of file sstring.cpp.

References c_str(), and operator=().

const char * SString::c_str  )  const
 

Get a plain pointer to the string.

Definition at line 74 of file sstring.cpp.

References GenericSReference< Tp, X_wrongtype >::GetPtr().

Referenced by SExpressionStreamCharbuf::Cleanup(), length(), operator+(), operator+=(), operator==(), operator[](), pretty_print(), and SExpressionStreamCharbuf::Ungetc().

char SString::operator[] int  index  )  const
 

Get the element (char) by index.

Warning:
no range checking is performed

Definition at line 77 of file sstring.hpp.

References c_str().

unsigned int SString::length  )  const
 

Get the length of the string.

Definition at line 89 of file sstring.cpp.

References c_str().

Referenced by SExpressionStreamCharbuf::Getc(), SExpressionStreamCharbuf::Gets(), Length(), pretty_print(), and SExpressionStreamCharbuf::Seek().

unsigned int SString::Length  )  const
 

Get the length of the string.

Definition at line 81 of file sstring.hpp.

References length().

bool SString::operator== const SString other  )  const
 

String comparision.

Definition at line 79 of file sstring.cpp.

References c_str().

bool SString::operator!= const SString other  )  const
 

String comparision.

Definition at line 84 of file sstring.cpp.

template<class Tp, class X_wrongtype>
Tp* GenericSReference< Tp, X_wrongtype >::GetPtr  )  const [inherited]
 

Get the appropriately typed pointer to the referenced object.

Reimplemented from SReference.

Definition at line 65 of file gensref.hpp.

Referenced by c_str(), SExpressionHashPackage::FindSymbol(), SchExpressionContext::GetAllSymbols(), LExpressionContext::GetAllSymbols(), SchExpressionContext::GetBinding(), LExpressionContext::GetBinding(), LExpressionContext::GetFunBinding(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::operator *(), SStreamTextInput::operator->(), GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >::operator->(), SVectorRef::operator[](), SVectorRef::SVectorRef(), and SExpressionVector::TextRepresentation().

template<class Tp, class X_wrongtype>
Tp& GenericSReference< Tp, X_wrongtype >::operator *  )  const [inherited]
 

Dereference (returns a reference to the pointe object).

Reimplemented from GenericReference< SExpression >.

Definition at line 69 of file gensref.hpp.

template<class Tp, class X_wrongtype>
Tp* GenericSReference< Tp, X_wrongtype >::operator->  )  const [inherited]
 

Select a field/method of the referenced object.

Reimplemented from GenericReference< SExpression >.

Definition at line 71 of file gensref.hpp.

SReference& SReference::AddAnotherItemToList const SReference right  )  [inherited]
 

Add item to list.

For a list, adds another dotted pair to its end. For non-lists, the result is undefined.

Referenced by SReference::operator,().

SReference& SReference::ChangeListEnd const SReference new_last  )  [inherited]
 

Make/change dotted list.

  • For a proper (non-dotted) list, replaces its terminating () with the given argument, therefore producing a dotted list.
    • for a dotted list, changes it's terminating value (the value which is after the dot)
    • for other types, the result is undefined

Referenced by SReference::operator||().

SReference SReference::MakeCons const SReference right  )  const [inherited]
 

Make a cons.

Produces a cons (dotted pair) using *this as the CAR and the given argument as the CDR

Referenced by SReference::operator^().

SReference& SReference::operator, const SReference r  )  [inherited]
 

List composing operation.

Operator "," is used to construct lists naturally, like this: (L| 1, 2, 3)

See also:
LListConstructor class

Reimplemented in SBacklinkRef, SDoubleListRef, LReference, and SchReference.

Definition at line 541 of file sexpress.hpp.

References SReference::AddAnotherItemToList().

Referenced by SchReference::operator,(), and LReference::operator,().

SReference& SReference::operator|| const SReference t  )  [inherited]
 

dotted list composing operation

Operator "||" is used to construct dotted lists, like this: ((L| 1, 2, 3) || 4) // (1 2 3 . 4)

See also:
LListConstructor class

Reimplemented in LReference, and SchReference.

Definition at line 548 of file sexpress.hpp.

References SReference::ChangeListEnd().

Referenced by SchReference::operator||(), and LReference::operator||().

SReference SReference::operator^ const SReference t  )  const [inherited]
 

CONS operation.

Operator "^" is used to produce conses

Definition at line 552 of file sexpress.hpp.

References SReference::MakeCons().

bool SReference::operator== const SReference other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 556 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator== const SExpression other  )  const [inherited]
 

Equality is just pointer comparision.

Definition at line 562 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SReference other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 559 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::operator!= const SExpression other  )  const [inherited]
 

Non-equality is just pointer comparision.

Definition at line 565 of file sexpress.hpp.

References SReference::GetPtr().

bool SReference::IsEql const SReference other  )  const [inherited]
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEql().

bool SReference::IsEqual const SReference other  )  const [inherited]
 

Reimplemented in LReference, and SchReference.

Referenced by SExprsAreEqual().

SReference& SReference::Car  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SDoubleListRange::Copy(), IntelibGenericReader::Get(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::Cdr  )  const [inherited]
 

Referenced by LExpressionMacro::Call(), SBacklinkRef::Remove(), SQueue::RemoveFirst(), RetrieveFunctionObject(), and stack_representation().

SReference& SReference::CCar  )  const [inherited]
 

SReference& SReference::CCdr  )  const [inherited]
 

intelib_float_t SReference::GetFloat  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

intelib_integer_t SReference::GetInt  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

const char* SReference::GetString  )  const [inherited]
 

Referenced by SExpressionIndirectTemplate< Tt >::Setf().

char SReference::GetSingleChar  )  const [inherited]
 

template<class Tp>
Tp * SReference::DynamicCastGetPtr  )  const [inherited]
 

Definition at line 687 of file sexpress.hpp.

References SReference::GetPtr(), IntelibTypeId::IsSubtypeOf(), and SExpression::TermType().

Referenced by LispLambdaBody::DoAnalyseLambdaList(), SExpressionBacklink::InsertAfter(), SBacklinkRef::operator,(), pretty_print(), IntelibGenericReader::Read(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), RetrieveFunctionObject(), SQueue::SQueue(), and SExpressionBacklink::~SExpressionBacklink().

template<class Tp>
Tp * SReference::SimpleCastGetPtr  )  const [inherited]
 

Definition at line 695 of file sexpress.hpp.

References SReference::GetPtr(), and SExpression::TermType().

SReference SReference::Clone  )  const [inherited]
 

Referenced by SExpressionVector::Clone(), and SExpressionHashTable::Clone().

SReference SReference::CopyList  )  const [inherited]
 

SReference SReference::CopyTree  )  const [inherited]
 

bool SReference::IsEmptyList  )  const [inherited]
 

Referenced by SBacklinkRef::Begin(), LExpressionMacro::Call(), SExpressionBacklink::ConnectBack(), SDoubleListRange::Copy(), SBacklinkRef::End(), SExpressionDoubleList::Exclude(), SDoubleListRange::Exhausted(), SExpressionDoubleList::Iterator::Exhausted(), SDoubleListRange::GetLast(), SBacklinkRef::GetPtr(), SBacklinkRef::InsertAfter(), SExpressionDoubleList::InsertListAfter(), SExpressionDoubleList::Iterator::IsBegin(), SQueue::IsEmpty(), SExpressionDoubleList::Iterator::IsEnd(), SBacklinkRef::operator++(), SBacklinkRef::operator,(), SDoubleListRange::RightEndMover::operator--(), SDoubleListRange::LeftEndMover::operator--(), SBacklinkRef::operator--(), pretty_print(), SExpressionDoubleList::Iterator::Remove(), SBacklinkRef::Remove(), SExpressionBacklink::RemoveNext(), SQueue::SQueue(), stack_representation(), SchReference::TextRepresentation(), LReference::TextRepresentation(), and SExpressionBacklink::~SExpressionBacklink().


The documentation for this class was generated from the following files:
Generated on Tue Dec 18 00:42:50 2007 for InteLib by  doxygen 1.4.1