mstring::MStringList Class Reference

An ordered list of MStrings. More...

#include <mstring.h>

List of all members.

Public Member Functions

 MStringList ()
 MStringList (const std::list< MString > &msl)
 MStringList (const_iterator start, const_iterator end)
 ~MStringList ()
MStringList operator+ (const MStringList &msl) const
MStringListoperator+= (const MStringList &msl)
const MStringoperator[] (int pos) const
MStringListoperator<< (const char *str)
MString join (const char *sep) const
bool contains (const char *str, bool ignoreCase=false) const
MStringList intersect (const MStringList &msl, bool ignoreCase=false) const
MStringList minus (const MStringList &msl, bool ignoreCase=false) const

Detailed Description

This class is an ordered list of MString objects. It inherits the interface of the STL list container (std::list<MString>).
See also:
Macro foreach(), operator<<(std::ostream&, const MStringList&).
Martin "Murphy" Gebert <Murphy dot Gebert at gmx dot de>

Constructor & Destructor Documentation

mstring::MStringList::MStringList (  ) 

Constructs an empty MStringList.

mstring::MStringList::MStringList ( const std::list< MString > &  msl  ) 

Constructs a copy of an existing MString list.

mstring::MStringList::MStringList ( const_iterator  start,
const_iterator  end 

Constructs a MStringList with the part of another MStringList the iterators point to.

mstring::MStringList::~MStringList (  ) 

Member Function Documentation

MStringList mstring::MStringList::operator+ ( const MStringList msl  )  const

Concatenates a MStringList to this one and returns the result as a new MStringList.

MStringList& mstring::MStringList::operator+= ( const MStringList msl  ) 

Appends another MStringList to this one.

const MString& mstring::MStringList::operator[] ( int  pos  )  const

Accessor for a single item in the list at the given position. Iterates over the list from the first or last item and returns a const reference to the item at position pos in the list (begin of list: pos == 0), or the last item if pos points to a position behind the last item, or the first item if pos points to a position before the first item. The result is undefined if the list is empty.
If pos is negative then items are counted backwards from the end of the contained string; -1 is the last item etc.

MStringList& mstring::MStringList::operator<< ( const char *  str  ) 

Inserter for appending strings to the list. This works like std::list::push_back().

MString mstring::MStringList::join ( const char *  sep  )  const

Joins all strings in the list into one, separating them with sep.

bool mstring::MStringList::contains ( const char *  str,
bool  ignoreCase = false 
) const

Checks if the given string is part of the list.

MStringList mstring::MStringList::intersect ( const MStringList msl,
bool  ignoreCase = false 
) const

Returns a list of all items common to this and another MStringList.

MStringList mstring::MStringList::minus ( const MStringList msl,
bool  ignoreCase = false 
) const

Returns a list of all items that are in this MStringList, but not in the other one; the result is a copy of this list without the items common to both lists.

Generated on Mon Jul 30 23:50:20 2007 for MString by  doxygen 1.5.2