#include <XList.h>


Public Member Functions | |
| XList () | |
| XList (const FileName &) | |
| XList (const FileName &, const Config &) | |
| XList (const XList &) | |
| const XList & | operator= (const XList &c) |
| bool | operator== (const XList &c) const |
| bool | operator!= (const XList &c) const |
| virtual | ~XList () |
| void | load (const FileName &f, const Config &c) |
| void | save (const FileName &f, const Config &c) const |
| void | save (const FileName &f) const |
| XLine & | addLine (String &key, String &value) |
| String | searchValue (String &index) |
| XLine & | addLine () |
| void | rewind () const |
| XLine & | getLine (unsigned long lineIndex) const |
| XLine * | getLine () const |
| XLine & | getAllElements () const |
| unsigned long | getLineCount () const |
| XLine * | findLine (const String &key, unsigned long idx=0) const |
| void | reset () |
| virtual String | toString () const |
| virtual String | getClassName () const |
Static Public Member Functions | |
| static XList & | create () |
Private Attributes | |
| RefVector< XLine > | _vector |
| unsigned long | _current |
| XLine | _line |
Friends | |
| class | TestXList |
| class | TestXListFileReader |
Class for
Definition at line 85 of file XList.h.
| XList::XList | ( | ) |
| XList::XList | ( | const FileName & | f ) | [explicit] |
| XList::XList | ( | const XList & | l ) |
Definition at line 84 of file XList.cpp.
References _vector, alize::RefVector< T >::addObject(), alize::XLine::duplicate(), alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().
| XList::~XList | ( | ) | [virtual] |
Definition at line 244 of file XList.cpp.
References _vector, and alize::RefVector< T >::deleteAllObjects().
Appends a new line to the list. The line becomes the current line
| key | the key of the line |
| value | the value of the line |
Definition at line 151 of file XList.cpp.
References _current, _vector, alize::RefVector< T >::addObject(), and create().
Referenced by alize::CmdLine::CmdLine(), alize::Seg::merge(), alize::XListFileReader::readList(), alize::Matrix< T >::saveDT(), and alize::Config::setParam().
| XLine & XList::addLine | ( | ) |
| XList & XList::create | ( | ) | [static] |
Definition at line 77 of file XList.cpp.
References alize::Object::assertMemoryIsAllocated(), and XList().
Referenced by addLine().
Finds a line. This line becomes the current line
| key | the key |
| idx | the index of the key |
Definition at line 179 of file XList.cpp.
References _current, _vector, alize::XLine::getElement(), alize::XLine::getElementCount(), alize::RefVector< T >::getObject(), NULL, and alize::RefVector< T >::size().
Referenced by alize::Config::existsParam(), and alize::Config::getParam().
| XLine & XList::getAllElements | ( | ) | const |
Gets all elements of the list.
The current element of the line is the first one.
Definition at line 193 of file XList.cpp.
References _line, _vector, alize::XLine::addElement(), alize::XLine::getElement(), alize::XLine::getElementCount(), alize::RefVector< T >::getObject(), alize::XLine::reset(), and alize::RefVector< T >::size().
| String XList::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
| XLine * XList::getLine | ( | ) | const |
Gets the current line. The next line becomes the current line.
The current element of the line is the first one.
Definition at line 169 of file XList.cpp.
References _current, _vector, alize::RefVector< T >::getObject(), NULL, alize::XLine::rewind(), and alize::RefVector< T >::size().
| XLine & XList::getLine | ( | unsigned long | lineIndex ) | const |
Gets a line by an index. The line becomes the current line.
The current element of the line is the first one.
| lineIndex | the index of the line to get |
| IndexOutOfBoundsException |
Definition at line 160 of file XList.cpp.
References _current, _vector, alize::RefVector< T >::getObject(), and alize::XLine::rewind().
Referenced by alize::CmdLine::copyIntoConfig(), alize::CmdLine::getContent(), alize::CmdLine::getName(), alize::Config::getParamContent(), alize::Config::getParamName(), alize::CmdLine::isShortOption(), alize::Matrix< T >::loadDT(), alize::Seg::merge(), alize::Config::setParam(), and alize::Config::toString().
| unsigned long XList::getLineCount | ( | ) | const |
Gets the number of lines in the list
Definition at line 211 of file XList.cpp.
References _vector, and alize::RefVector< T >::size().
Referenced by alize::CmdLine::copyIntoConfig(), alize::CmdLine::getOptionCount(), alize::Config::getParamCount(), alize::Seg::merge(), save(), and alize::Config::setParam().
Loads a XList from a file
| f | the file to read |
| c | the configuration to use |
| IOException | if an I/O error occurs |
| FileNotFoundException |
Definition at line 115 of file XList.cpp.
References alize::XListFileReader::readList().
Referenced by XList().
Definition at line 91 of file XList.cpp.
References _current, _vector, alize::RefVector< T >::addObject(), alize::RefVector< T >::deleteAllObjects(), alize::XLine::duplicate(), alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().
| bool XList::operator== | ( | const XList & | c ) | const |
Definition at line 103 of file XList.cpp.
References _vector, alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().
| void XList::reset | ( | ) |
Remove all lines
Definition at line 205 of file XList.cpp.
References _current, _vector, and alize::RefVector< T >::deleteAllObjects().
Referenced by alize::XListFileReader::readList(), and alize::Config::reset().
| void XList::rewind | ( | ) | const |
Sets the first line to become the current line
Definition at line 158 of file XList.cpp.
References _current.
Referenced by alize::Matrix< T >::loadDT(), alize::XListFileReader::readList(), alize::Config::setParam(), and alize::Config::toString().
Saves this XList in a ascii file
| f | the file to create |
| c | the configuration to use |
Definition at line 123 of file XList.cpp.
References _vector, alize::String::c_str(), alize::XLine::getElement(), alize::XLine::getElementCount(), getLineCount(), and alize::RefVector< T >::getObject().
Referenced by alize::Matrix< T >::saveDT().
| void XList::save | ( | const FileName & | f ) | const |
Search the value of an index
| index | the index of the line |
Definition at line 217 of file XList.cpp.
References _vector, alize::XLine::getElement(), alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().
| String XList::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Definition at line 231 of file XList.cpp.
References _vector, alize::XLine::getElement(), alize::XLine::getElementCount(), alize::RefVector< T >::getObject(), and alize::RefVector< T >::size().
unsigned long alize::XList::_current [mutable, private] |
Definition at line 190 of file XList.h.
Referenced by addLine(), findLine(), getLine(), operator=(), reset(), and rewind().
XLine alize::XList::_line [mutable, private] |
Definition at line 191 of file XList.h.
Referenced by getAllElements().
RefVector<XLine> alize::XList::_vector [private] |
Definition at line 189 of file XList.h.
Referenced by addLine(), findLine(), getAllElements(), getLine(), getLineCount(), operator=(), operator==(), reset(), save(), searchValue(), toString(), XList(), and ~XList().
1.7.2