AVRCpp::Collection::BaseString Class Reference

#include <BaseString.h>

Inherited by AVRCpp::Collection::DynamicString< blockSize >, AVRCpp::Collection::DynamicString< 1 >, and AVRCpp::Collection::StaticString< capacity >.

List of all members.

Public Types

enum  FindResult { NotFound = 0xFFFF }
 
See also:
BaseString::Find
More...

Public Member Functions

 BaseString ()
virtual ~BaseString ()
uint16_t GetLength () const
 Returns length of this string.
cstr_t Get () const
 Returns pointer to null-terminated string.
cstr_t Get (uint16_t index) const
 Returns pointer to null-terminated string from specified index.
bool SetLength (uint16_t newLength)
 Truncates string to the 'newLength'.
bool FromInt (int16_t i)
 Gives this string new value reflecting numeric value in decimal string representation.
bool FromIntBin (int16_t i)
 Gives this string new value reflecting numeric value in binary string representation.
bool FromIntOct (int16_t i)
 Gives this string new value reflecting numeric value in octal string representation.
bool FromIntHex (int16_t i)
 Gives this string new value reflecting numeric value in hexadecimal string representation.
bool FromDouble (double d)
 Gives this string new value reflecting numeric value in decimal string representation.
bool Copy (cstr_t source)
 Gives new value to this string.
bool Copy (const BaseString &source)
 Gives new value to this string.
bool Copy (cstr_t source, uint16_t n)
 Gives new value to this string.
bool Copy (const BaseString &source, uint16_t n)
 Gives new value to this string.
bool Join (cstr_t value)
 Appends 'value' to this string.
bool Join (const BaseString &value)
 Appends 'value' to this string.
bool Join (cstr_t value, uint16_t n)
 Appends 'n' characters from 'value' to this string.
bool Join (const BaseString &value, uint16_t n)
 Appends 'n' characters from 'value' to this string.
uint16_t Find (uint16_t index, const BaseString &value)
 Finds the first occurrence of 'value' from character position specified with 'index'.
uint16_t Find (uint16_t index, cstr_t value)
 Finds the first occurrence of 'value' from character position specified with 'index'.
uint16_t IFind (uint16_t index, const BaseString &value)
 Finds the first occurrence of 'value' from character position specified with 'index'.
uint16_t IFind (uint16_t index, cstr_t value)
 Finds the first occurrence of 'value' from character position specified with 'index'.
bool Replace (uint16_t begin, uint16_t end, const BaseString &replaceWith)
 Replaces string from index 'begin' to index 'end' with 'replaceWith'.
bool Replace (uint16_t begin, uint16_t end, cstr_t replaceWith)
 Replaces string from index 'begin' to index 'end' with 'replaceWith'.
bool Insert (uint16_t index, const BaseString &value)
 Inserts 'value' into this string to the character position specified with 'index'.
bool Insert (uint16_t index, cstr_t value)
 Inserts 'value' into this string to the character position specified with 'index'.
char_t GetChar (uint16_t index) const
 Returns character from specified index.
bool StartsWith (cstr_t value) const
 Returns true if first characters match with 'value'.
bool StartsWith (BaseString &value) const
 Returns true if first characters match with 'value'.
bool IStartsWith (cstr_t value) const
 Returns true if first characters match with 'value'.
bool IStartsWith (BaseString &value) const
 Returns true if first characters match with 'value'.
bool EndsWith (cstr_t value) const
 Returns true if last characters match with 'value'.
bool EndsWith (const BaseString &value) const
 Returns true if last characters match with 'value'.
bool IEndsWith (cstr_t value) const
 Returns true if last characters match with 'value'.
bool IEndsWith (const BaseString &value) const
 Returns true if last characters match with 'value'.
bool Reserve (uint16_t size)
 To set preferred capacity (in characters) of this string container.
void ToUpper ()
 Converts the whole string to upper case.
void ToLower ()
 Converts the whole string to lower case.
double GetDouble () const
 Returns numeric representation from the beginning of the string.
int GetInteger () const
 Returns numeric representation from the beginning of the string.
int Compare (cstr_t comparable) const
 Case-sensetive string compare.
int Compare (BaseString &comparable) const
 Case-sensetive string compare.
int ICompare (cstr_t comparable) const
 String compare that ignores case.
int ICompare (BaseString &comparable) const
 String compare that ignores case.
cstr_t operator() () const
 Returns pointer to null-terminated string.
cstr_t operator() (uint16_t index) const
 Returns pointer to null-terminated string from specified index.
char_t operator[] (uint16_t index) const
 Returns character from specified index.
BaseStringoperator+= (BaseString &s)
 Appends 's' to this string.
BaseStringoperator+= (cstr_t s)
 Appends 's' to this string.
bool operator< (BaseString &s) const
 Case-sensetive comparison.
bool operator> (BaseString &s) const
 Case-sensetive comparison.
bool operator<= (BaseString &s) const
 Case-sensetive comparison.
bool operator>= (BaseString &s) const
 Case-sensetive comparison.
bool operator== (BaseString &s) const
 Case-sensetive comparison.
bool operator!= (BaseString &s) const
 Case-sensetive comparison.
bool operator< (cstr_t s) const
 Case-sensetive comparison.
bool operator> (cstr_t s) const
 Case-sensetive comparison.
bool operator<= (cstr_t s) const
 Case-sensetive comparison.
bool operator>= (cstr_t s) const
 Case-sensetive comparison.
bool operator== (cstr_t s) const
 Case-sensetive comparison.
bool operator!= (cstr_t s) const
 Case-sensetive comparison.

Protected Member Functions

virtual bool EnsureCapacity (uint16_t required)=0
 Makes sure that required number of bytes can be stored in buffer.
bool SubJoin (cstr_t joinable, uint16_t joinableLength)
bool SubJoin (cstr_t joinable, uint16_t n, uint16_t joinableLength)
bool SubCopy (cstr_t source, uint16_t sourceLength)
bool SubReplace (uint16_t begin, uint16_t end, cstr_t replaceWith, uint16_t replaceWithLength)
uint16_t SubFind (uint16_t index, cstr_t value, uint16_t valueLength) const
uint16_t SubIFind (uint16_t index, cstr_t value, uint16_t valueLength) const
template<uint8_t radix, uint8_t requiredSpace>
bool SubFromInt (int16_t i)

Protected Attributes

str_t me
 Pointer to character array.
uint16_t length
 My string length.
uint16_t size
 Number of characters currently allocated from memory.


Detailed Description

Definition at line 38 of file BaseString.h.


Member Enumeration Documentation

enum AVRCpp::Collection::BaseString::FindResult

See also:
BaseString::Find

Enumerator:
NotFound 

Definition at line 81 of file BaseString.h.

00082                         {
00083                                 NotFound = 0xFFFF
00084                                 
00085                         }; // enum FindResult


Constructor & Destructor Documentation

AVRCpp::Collection::BaseString::BaseString (  )  [inline]

Definition at line 87 of file BaseString.h.

00087 : me(NULL), length(0), size(0) {}

virtual AVRCpp::Collection::BaseString::~BaseString (  )  [inline, virtual]

Definition at line 88 of file BaseString.h.

00088 {}


Member Function Documentation

virtual bool AVRCpp::Collection::BaseString::EnsureCapacity ( uint16_t  required  )  [protected, pure virtual]

Makes sure that required number of bytes can be stored in buffer.

Only derived class handles memory allocation.

Returns:
true if there is enough space, otherwise false.

Implemented in AVRCpp::Collection::StaticString< capacity >, AVRCpp::Collection::DynamicString< blockSize >, and AVRCpp::Collection::DynamicString< 1 >.

bool BaseString::SubJoin ( cstr_t  joinable,
uint16_t  joinableLength 
) [protected]

Definition at line 85 of file String.cpp.

00086 {
00087         uint16_t newLength = valueLength + length;
00088 
00089         if (newLength > length)
00090         {
00091                 if (!EnsureCapacity(newLength + 1) )
00092                         return false;
00093                 
00094                 if (length)
00095                         StrJoin(me, value);
00096                 else
00097                         StrCopy(me, value);
00098                 
00099                 length = newLength;
00100         }
00101         return true;
00102 
00103 } // SubJoin 1

bool BaseString::SubJoin ( cstr_t  joinable,
uint16_t  n,
uint16_t  joinableLength 
) [protected]

Definition at line 106 of file String.cpp.

00107 {
00108         uint16_t minLength = valueLength > n ? n : valueLength;
00109         uint16_t newLength = minLength + length;
00110 
00111         if (newLength > length)
00112         {
00113                 if (!EnsureCapacity(newLength + 1) )
00114                         return false;
00115                 
00116                 StrNCopy(me + length, value, minLength);
00117                 me[newLength] = '\0';
00118                 
00119                 length = newLength;
00120         }
00121         return true;
00122 
00123 } // SubJoin 2

bool BaseString::SubCopy ( cstr_t  source,
uint16_t  sourceLength 
) [protected]

Definition at line 126 of file String.cpp.

00127 {
00128         if (sourceLength == 0 && !me)
00129                 return true;
00130 
00131         if (!EnsureCapacity(sourceLength + 1) )
00132                 return false;
00133 
00134         StrCopy(me, source);
00135         length = sourceLength;
00136         return true;
00137 
00138 } // SubCopy

bool BaseString::SubReplace ( uint16_t  begin,
uint16_t  end,
cstr_t  replaceWith,
uint16_t  replaceWithLength 
) [protected]

Definition at line 234 of file String.cpp.

00235 {
00236         if (begin > length || end > length || begin > end)
00237                 return false;
00238         
00239         if (replaceWithLength)
00240         {
00241                 if (end == length)
00242                 {
00243                         uint16_t length1 = begin + replaceWithLength;
00244                         
00245                         if (!EnsureCapacity(length1 + 1) )
00246                                 return false;
00247                         
00248                         StrCopy(me + begin, replaceWith);
00249                         length = length1;
00250                 }
00251                 else
00252                 {
00253                         String strEnd;
00254 
00255                         strEnd.Copy(me + end);
00256                         uint16_t length1 = begin + replaceWithLength;
00257                         uint16_t length2 = length1 + strEnd.GetLength();
00258                         
00259                         if (!EnsureCapacity(length2 + 1) )
00260                                 return false;
00261                         
00262                         StrCopy(me + begin, replaceWith);
00263                         StrCopy(me + length1, strEnd.Get() );
00264                         length = length2;
00265                 }
00266         }
00267         else if (begin != end)
00268         {
00269                 if (end == length)
00270                 {
00271                         me[begin] = '\0';
00272                         length = begin;
00273                 }
00274                 else
00275                 {
00276                         StrCopy(me + begin, me + end);
00277                         length -= end - begin;
00278                 }
00279         }
00280 
00281         return true;
00282 
00283 } // Replace

uint16_t BaseString::SubFind ( uint16_t  index,
cstr_t  value,
uint16_t  valueLength 
) const [protected]

Definition at line 158 of file String.cpp.

00159 {
00160         
00161         if (valueLength)
00162         {
00163                 str_t pointer = StrFind(Get(index), value);
00164                 
00165                 if (pointer)
00166                         return (uint16_t)(pointer - me);
00167                 
00168         }
00169 
00170         return NotFound;
00171         
00172 } // SubFind

uint16_t BaseString::SubIFind ( uint16_t  index,
cstr_t  value,
uint16_t  valueLength 
) const [protected]

Definition at line 174 of file String.cpp.

00175 {
00176         
00177         if (valueLength)
00178         {
00179                 str_t pointer = StrFind(Get(index), value);
00180                 
00181                 if (pointer)
00182                         return (uint16_t)(pointer - me);
00183                 
00184         }
00185 
00186         return NotFound;
00187         
00188 } // SubIFind

template<uint8_t radix, uint8_t requiredSpace>
bool AVRCpp::Collection::BaseString::SubFromInt ( int16_t  i  )  [inline, protected]

Definition at line 66 of file BaseString.h.

00067                         {
00068                                 if (!EnsureCapacity(requiredSpace) )
00069                                         return false;
00070                                 
00071                                 ToString(i, me, radix);
00072                                 
00073                                 length = StrLength(me);
00074                                 return true;
00075                                 
00076                         } // SubFromInt

uint16_t AVRCpp::Collection::BaseString::GetLength (  )  const [inline]

Returns length of this string.

Definition at line 93 of file BaseString.h.

00093 { return length; }

cstr_t AVRCpp::Collection::BaseString::Get (  )  const [inline]

Returns pointer to null-terminated string.

Note:
Do not modify the content pointed by the returned value. It is for read only!

Definition at line 99 of file BaseString.h.

00099 { return me != NULL ? me : STR_NULL; }

cstr_t AVRCpp::Collection::BaseString::Get ( uint16_t  index  )  const [inline]

Returns pointer to null-terminated string from specified index.

Note:
Do not modify the content pointed by the returned value. It is for read only!

Definition at line 105 of file BaseString.h.

00105 { return (index < length) ? me + index : STR_NULL; }

bool BaseString::SetLength ( uint16_t  newLength  ) 

Truncates string to the 'newLength'.

Returns:
true on success. If 'newLength' is not greater than current string length then false is returned.

Definition at line 57 of file String.cpp.

00058 {
00059         if (newLength < length)
00060         {
00061                 me[newLength] = '\0';
00062                 length = newLength;
00063                 return true;
00064         }
00065         return false;
00066 
00067 } // SetLength

bool AVRCpp::Collection::BaseString::FromInt ( int16_t  i  )  [inline]

Gives this string new value reflecting numeric value in decimal string representation.

Definition at line 116 of file BaseString.h.

00116 { return SubFromInt<10, 7>(i); }

bool AVRCpp::Collection::BaseString::FromIntBin ( int16_t  i  )  [inline]

Gives this string new value reflecting numeric value in binary string representation.

Definition at line 121 of file BaseString.h.

00121 { return SubFromInt<2, 18>(i); }

bool AVRCpp::Collection::BaseString::FromIntOct ( int16_t  i  )  [inline]

Gives this string new value reflecting numeric value in octal string representation.

Definition at line 126 of file BaseString.h.

00126 { return SubFromInt<8, 8>(i); }

bool AVRCpp::Collection::BaseString::FromIntHex ( int16_t  i  )  [inline]

Gives this string new value reflecting numeric value in hexadecimal string representation.

Definition at line 131 of file BaseString.h.

00131 { return SubFromInt<16, 6>(i); }

bool BaseString::FromDouble ( double  d  ) 

Gives this string new value reflecting numeric value in decimal string representation.

Definition at line 70 of file String.cpp.

00071 {
00072         if (!EnsureCapacity(128) )
00073                 return false;
00074 
00075     int result = DoubleToString(me, d);
00076 
00077         if (result == EOF) return false;
00078 
00079         length = (uint16_t)result;
00080         return true;
00081 
00082 } // FromDouble

bool AVRCpp::Collection::BaseString::Copy ( cstr_t  source  )  [inline]

Gives new value to this string.

Definition at line 141 of file BaseString.h.

00141 { return SubCopy(source, StrLength(source) ); }

bool AVRCpp::Collection::BaseString::Copy ( const BaseString source  )  [inline]

Gives new value to this string.

Definition at line 146 of file BaseString.h.

00146 { return SubCopy(source.Get(), source.GetLength() ); }

bool BaseString::Copy ( cstr_t  source,
uint16_t  n 
)

Gives new value to this string.

Only 'n' first characters are copied from source to this string.

Definition at line 141 of file String.cpp.

00142 {
00143         if (n == 0 && !me)
00144                 return true;
00145 
00146         if (!EnsureCapacity(n + 1) )
00147                 return false;
00148 
00149         StrNCopy(me, source, n);
00150         me[n] = '\0';
00151 
00152         length = n;
00153         return true;
00154 
00155 } // Copy

bool AVRCpp::Collection::BaseString::Copy ( const BaseString source,
uint16_t  n 
) [inline]

Gives new value to this string.

Only 'n' first characters are copied from source to this string.

Definition at line 156 of file BaseString.h.

00156 { return Copy(source.Get(), n); }

bool AVRCpp::Collection::BaseString::Join ( cstr_t  value  )  [inline]

Appends 'value' to this string.

Definition at line 161 of file BaseString.h.

00161 { return SubJoin(value, StrLength(value) ); }

bool AVRCpp::Collection::BaseString::Join ( const BaseString value  )  [inline]

Appends 'value' to this string.

Definition at line 166 of file BaseString.h.

00166 { return SubJoin(value.Get(), value.GetLength() ); }

bool AVRCpp::Collection::BaseString::Join ( cstr_t  value,
uint16_t  n 
) [inline]

Appends 'n' characters from 'value' to this string.

Definition at line 171 of file BaseString.h.

00171 { return SubJoin(value, n, StrLength(value) ); }

bool AVRCpp::Collection::BaseString::Join ( const BaseString value,
uint16_t  n 
) [inline]

Appends 'n' characters from 'value' to this string.

Definition at line 176 of file BaseString.h.

00176 { return SubJoin(value.Get(), n, value.GetLength() ); }

uint16_t AVRCpp::Collection::BaseString::Find ( uint16_t  index,
const BaseString value 
) [inline]

Finds the first occurrence of 'value' from character position specified with 'index'.

Comparison is case-sensetive.

Returns:
On success returns index pointing to the starting of the substring, otherwise BaseString::NotFound is returned.

Definition at line 184 of file BaseString.h.

00184 { return SubFind(index, value.Get(), value.GetLength() ); }

uint16_t AVRCpp::Collection::BaseString::Find ( uint16_t  index,
cstr_t  value 
) [inline]

Finds the first occurrence of 'value' from character position specified with 'index'.

Comparison is case-sensetive.

Returns:
On success returns index pointing to the starting of the substring, otherwise BaseString::NotFound is returned.

Definition at line 192 of file BaseString.h.

00192 { return SubFind(index, value, StrLength(value) ); }

uint16_t AVRCpp::Collection::BaseString::IFind ( uint16_t  index,
const BaseString value 
) [inline]

Finds the first occurrence of 'value' from character position specified with 'index'.

Case is ignored during the comparison.

Returns:
On success returns index pointing to the starting of the substring, otherwise BaseString::NotFound is returned.

Definition at line 200 of file BaseString.h.

00200 { return SubIFind(index, value.Get(), value.GetLength() ); }

uint16_t AVRCpp::Collection::BaseString::IFind ( uint16_t  index,
cstr_t  value 
) [inline]

Finds the first occurrence of 'value' from character position specified with 'index'.

Case is ignored during the comparison.

Returns:
On success returns index pointing to the starting of the substring, otherwise BaseString::NotFound is returned.

Definition at line 208 of file BaseString.h.

00208 { return SubIFind(index, value, StrLength(value) ); }

bool AVRCpp::Collection::BaseString::Replace ( uint16_t  begin,
uint16_t  end,
const BaseString replaceWith 
) [inline]

Replaces string from index 'begin' to index 'end' with 'replaceWith'.

Returns:
true on success.

Definition at line 214 of file BaseString.h.

00214 { return SubReplace(begin, end, replaceWith.Get(), replaceWith.GetLength() ); }

bool AVRCpp::Collection::BaseString::Replace ( uint16_t  begin,
uint16_t  end,
cstr_t  replaceWith 
) [inline]

Replaces string from index 'begin' to index 'end' with 'replaceWith'.

Returns:
true on success.

Definition at line 220 of file BaseString.h.

00220 { return SubReplace(begin, end, replaceWith, StrLength(replaceWith) ); }

bool AVRCpp::Collection::BaseString::Insert ( uint16_t  index,
const BaseString value 
) [inline]

Inserts 'value' into this string to the character position specified with 'index'.

Definition at line 225 of file BaseString.h.

00225 { return Replace(index, index, value); }

bool AVRCpp::Collection::BaseString::Insert ( uint16_t  index,
cstr_t  value 
) [inline]

Inserts 'value' into this string to the character position specified with 'index'.

Definition at line 230 of file BaseString.h.

00230 { return Replace(index, index, value); }

char_t AVRCpp::Collection::BaseString::GetChar ( uint16_t  index  )  const [inline]

Returns character from specified index.

Returns:
'' if index is out of bounds.

Definition at line 236 of file BaseString.h.

00236 { return (index < length) ? me[index] : '\0'; }

bool AVRCpp::Collection::BaseString::StartsWith ( cstr_t  value  )  const [inline]

Returns true if first characters match with 'value'.

Comparison is case-sensetive.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 242 of file BaseString.h.

00242 { return StrNCompare(Get(), value, StrLength(value) ) == 0; }

bool AVRCpp::Collection::BaseString::StartsWith ( BaseString value  )  const [inline]

Returns true if first characters match with 'value'.

Comparison is case-sensetive.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 248 of file BaseString.h.

00248 { return StrNCompare(Get(), value.Get(), value.GetLength() ) == 0; }

bool AVRCpp::Collection::BaseString::IStartsWith ( cstr_t  value  )  const [inline]

Returns true if first characters match with 'value'.

Case is ignored during the comparison.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 254 of file BaseString.h.

00254 { return StrNICompare(Get(), value, StrLength(value) ) == 0; }

bool AVRCpp::Collection::BaseString::IStartsWith ( BaseString value  )  const [inline]

Returns true if first characters match with 'value'.

Case is ignored during the comparison.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 260 of file BaseString.h.

00260 { return StrNICompare(Get(), value.Get(), value.GetLength() ) == 0; }

bool BaseString::EndsWith ( cstr_t  value  )  const

Returns true if last characters match with 'value'.

Comparison is case-sensetive.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 191 of file String.cpp.

00192 {
00193         uint16_t valueLength = StrLength(value);
00194         if (valueLength > length)
00195                 return false;
00196         
00197         return StrCompare(Get(length - valueLength), value) == 0;
00198         
00199 } // EndsWith 1

bool BaseString::EndsWith ( const BaseString value  )  const

Returns true if last characters match with 'value'.

Comparison is case-sensetive.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 202 of file String.cpp.

00203 {
00204         if (value.GetLength() > length)
00205                 return false;
00206         
00207         return StrCompare(Get(length - value.GetLength() ), value.Get() ) == 0;
00208         
00209 } // EndsWith 2

bool BaseString::IEndsWith ( cstr_t  value  )  const

Returns true if last characters match with 'value'.

Case is ingored during the comparison.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 212 of file String.cpp.

00213 {
00214         uint16_t valueLength = StrLength(value);
00215         
00216         if (valueLength > length)
00217                 return false;
00218         
00219         return StrICompare(Get(length - valueLength), value) == 0;
00220         
00221 } // IEndsWith 1

bool BaseString::IEndsWith ( const BaseString value  )  const

Returns true if last characters match with 'value'.

Case is ingored during the comparison.

Returns:
Always false in case length of 'value' is greater than length of this string.

Definition at line 224 of file String.cpp.

00225 {
00226         if (value.GetLength() > length)
00227                 return false;
00228         
00229         return StrICompare(Get(length - value.GetLength() ), value.Get() ) == 0;
00230         
00231 } // IEndsWith 2

bool AVRCpp::Collection::BaseString::Reserve ( uint16_t  size  )  [inline]

To set preferred capacity (in characters) of this string container.

Allocator object only takes it into consideration. It is not guaranteed that buffer is taking exactly the the amount of memory specified with 'size' after calling this function.

Returns:
true on success - it means capacity is not less than 'size' characters.

Definition at line 293 of file BaseString.h.

00293 { return EnsureCapacity(size); }

void AVRCpp::Collection::BaseString::ToUpper (  )  [inline]

Converts the whole string to upper case.

Definition at line 298 of file BaseString.h.

00298 { if (me) StrToUpper(me); }

void AVRCpp::Collection::BaseString::ToLower (  )  [inline]

Converts the whole string to lower case.

Definition at line 303 of file BaseString.h.

00303 { if (me) StrToLower(me); }

double AVRCpp::Collection::BaseString::GetDouble (  )  const [inline]

Returns numeric representation from the beginning of the string.

Definition at line 308 of file BaseString.h.

00308 { return ToDouble(Get() ); }

int AVRCpp::Collection::BaseString::GetInteger (  )  const [inline]

Returns numeric representation from the beginning of the string.

Definition at line 313 of file BaseString.h.

00313 { return ToInteger(Get() ); }

int AVRCpp::Collection::BaseString::Compare ( cstr_t  comparable  )  const [inline]

Case-sensetive string compare.

Returns:
zero in case equal

Definition at line 319 of file BaseString.h.

00319 { return StrCompare(Get(), comparable); }

int AVRCpp::Collection::BaseString::Compare ( BaseString comparable  )  const [inline]

Case-sensetive string compare.

Returns:
zero in case equal

Definition at line 325 of file BaseString.h.

00325 { return StrCompare(Get(), comparable.Get() ); }

int AVRCpp::Collection::BaseString::ICompare ( cstr_t  comparable  )  const [inline]

String compare that ignores case.

Returns:
zero in case equal

Definition at line 331 of file BaseString.h.

00331 { return StrICompare(Get(), comparable); }

int AVRCpp::Collection::BaseString::ICompare ( BaseString comparable  )  const [inline]

String compare that ignores case.

Returns:
zero in case equal

Definition at line 337 of file BaseString.h.

00337 { return StrICompare(Get(), comparable.Get() ); }

cstr_t AVRCpp::Collection::BaseString::operator() (  )  const [inline]

Returns pointer to null-terminated string.

Note:
Do not modify the content pointed by the returned value. It is for read only!

Definition at line 343 of file BaseString.h.

00343 { return Get(); }

cstr_t AVRCpp::Collection::BaseString::operator() ( uint16_t  index  )  const [inline]

Returns pointer to null-terminated string from specified index.

Note:
Do not modify the content pointed by the returned value. It is for read only!

Definition at line 349 of file BaseString.h.

00349 { return Get(index); }

char_t AVRCpp::Collection::BaseString::operator[] ( uint16_t  index  )  const [inline]

Returns character from specified index.

Returns:
'' if index is out of bounds.

Definition at line 355 of file BaseString.h.

00355 { return GetChar(index); }

BaseString& AVRCpp::Collection::BaseString::operator+= ( BaseString s  )  [inline]

Appends 's' to this string.

Definition at line 360 of file BaseString.h.

00360 { Join(s.Get() ); return *this; }

BaseString& AVRCpp::Collection::BaseString::operator+= ( cstr_t  s  )  [inline]

Appends 's' to this string.

Definition at line 365 of file BaseString.h.

00365 { Join(s); return *this; }

bool AVRCpp::Collection::BaseString::operator< ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 370 of file BaseString.h.

00370 { return Compare(s) < 0; }

bool AVRCpp::Collection::BaseString::operator> ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 375 of file BaseString.h.

00375 { return Compare(s) > 0; }

bool AVRCpp::Collection::BaseString::operator<= ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 380 of file BaseString.h.

00380 { return Compare(s) <= 0; }

bool AVRCpp::Collection::BaseString::operator>= ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 385 of file BaseString.h.

00385 { return Compare(s) >= 0; }

bool AVRCpp::Collection::BaseString::operator== ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 390 of file BaseString.h.

00390 { return Compare(s) == 0; }

bool AVRCpp::Collection::BaseString::operator!= ( BaseString s  )  const [inline]

Case-sensetive comparison.

Definition at line 395 of file BaseString.h.

00395 { return Compare(s) != 0; }

bool AVRCpp::Collection::BaseString::operator< ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 400 of file BaseString.h.

00400 { return Compare(s) < 0; }

bool AVRCpp::Collection::BaseString::operator> ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 405 of file BaseString.h.

00405 { return Compare(s) > 0; }

bool AVRCpp::Collection::BaseString::operator<= ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 410 of file BaseString.h.

00410 { return Compare(s) <= 0; }

bool AVRCpp::Collection::BaseString::operator>= ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 415 of file BaseString.h.

00415 { return Compare(s) >= 0; }

bool AVRCpp::Collection::BaseString::operator== ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 420 of file BaseString.h.

00420 { return Compare(s) == 0; }

bool AVRCpp::Collection::BaseString::operator!= ( cstr_t  s  )  const [inline]

Case-sensetive comparison.

Definition at line 425 of file BaseString.h.

00425 { return Compare(s) != 0; }


Member Data Documentation

str_t AVRCpp::Collection::BaseString::me [protected]

Pointer to character array.

Definition at line 43 of file BaseString.h.

uint16_t AVRCpp::Collection::BaseString::length [protected]

My string length.

Definition at line 46 of file BaseString.h.

uint16_t AVRCpp::Collection::BaseString::size [protected]

Number of characters currently allocated from memory.

Definition at line 49 of file BaseString.h.


The documentation for this class was generated from the following files:
Generated on Sat Sep 15 23:41:47 2007 for AVR C++ Lib (common) by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi