net::halfdans::StringList Class Reference

A std::vector<String> specialisation with some methods to make working with vectors of strings somewhat easier. More...

#include <hstring.hpp>

Inherits std::vector< net::halfdans::String >.

Collaboration diagram for net::halfdans::StringList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Stringoperator[] (int _index)
 Get a refence to the string at the specified position, but supports Python-like negative indexing.
const Stringoperator[] (int _index) const
 Const variant of operator[].
void purgeEmpty ()
 Remove strings which are completely empty, as in std::string::empty() returns true.
void stripAndPurgeEmpty (const std::string &_letters=" \t\r\n")
 Remove string which consists only of characters from the _letters string.


Detailed Description

A std::vector<String> specialisation with some methods to make working with vectors of strings somewhat easier.

Member Function Documentation

String& net::halfdans::StringList::operator[] ( int  _index  )  [inline]

Get a refence to the string at the specified position, but supports Python-like negative indexing.

See also:
String::operator[] ( int _index )

const String& net::halfdans::StringList::operator[] ( int  _index  )  const [inline]

Const variant of operator[].

See also:
String & operator[] ( int _index )

void net::halfdans::StringList::purgeEmpty (  )  [inline]

Remove strings which are completely empty, as in std::string::empty() returns true.

void net::halfdans::StringList::stripAndPurgeEmpty ( const std::string &  _letters = " \t\r\n"  )  [inline]

Remove string which consists only of characters from the _letters string.

   // list is: "1", "2  ", "  3  ", "", "   ", "  5"
   StringList list;
   list.stripAndPurgeEmpty();
   // list is now: "1", "2  ", "  3  ", "  5"


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

Generated on Thu Jul 10 23:30:20 2008 for hstring by  doxygen 1.5.6