Relacs
0.9.8
|
#include <strqueue.h>
Public Member Functions | |
StrQueue (void) | |
StrQueue (const StrQueue &sq) | |
StrQueue (const Str &s, const string &separator) | |
StrQueue (const Str &s, const string &separator, const string &brackets) | |
~StrQueue (void) | |
StrQueue & | operator= (const StrQueue &sq) |
StrQueue & | operator= (const string &s) |
StrQueue & | assign (const string &s) |
StrQueue & | assign (const Str &s, const string &separator) |
StrQueue & | assign (const Str &s, const string &separator, const string &brackets) |
StrQueue & | append (const Str &s, const string &separator) |
StrQueue & | append (const Str &s, const string &separator, const string &brackets) |
StrQueue & | copy (string &s, const string &separator) |
int | size (void) const |
bool | empty (void) const |
void | resize (int n, const Str &s=Str()) |
void | clear (void) |
Str & | operator[] (int index) |
const Str & | operator[] (int index) const |
int | find (const string &strg, int index=0) const |
void | add (const string &s) |
void | add (const StrQueue &sq) |
void | insert (const string &s) |
void | insert (const StrQueue &sq) |
iterator | erase (iterator pos) |
void | erase (int index) |
iterator | erase (iterator first, iterator last) |
iterator | erase (int from, int to) |
void | reverse (void) |
void | sort (void) |
StrQueue & | strip (void) |
StrQueue & | stripComments (const string &comment=Str::comment()) |
StrQueue | strippedComments (const string &comment=Str::comment()) const |
string | save (const string &separator=" ") const |
istream & | load (istream &str, const string &stop="", string *line=0) |
ostream & | save (ostream &str, const string &start="") const |
Static Public Attributes | |
static string | StopEmpty = "EMPTY" |
Friends | |
bool | operator== (const StrQueue &sq1, const StrQueue &sq2) |
ostream & | operator<< (ostream &str, const StrQueue &sq) |
A list of strings.
|
inline |
Constructs an empty list of strings.
Referenced by StrQueue::strippedComments().
Assign the fields of s separated by separator to the StrQueue.
References StrQueue::assign().
Assign the fields of s separated by separator to the StrQueue while respecting brackets.
References StrQueue::assign().
|
inline |
Create a list with the single element s.
StrQueue & assign | ( | const string & | s | ) |
Create a list with the single element s.
References StrQueue::add(), and StrQueue::clear().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Options::find(), Options::findSection(), Options::rfind(), Options::rfindSection(), Parameter::selectText(), and StrQueue::StrQueue().
Assign the fields of s separated by separator to the StrQueue.
References StrQueue::append(), and StrQueue::clear().
Assign the fields of s separated by separator to the StrQueue while respecting brackets.
References StrQueue::append(), and StrQueue::clear().
Append the fields of s separated by separator to the StrQueue.
References StrQueue::add(), Str::mid(), and Str::nextField().
Referenced by StrQueue::assign(), and RELACSWidget::RELACSWidget().
Append the fields of s separated by separator to the StrQueue while respecting brackets.
References StrQueue::add(), Str::findSeparator(), and Str::mid().
StrQueue & copy | ( | string & | s, |
const string & | separator | ||
) |
Write the elements of the StrQueue into s separated by separator.
|
inline |
The number of strings in the list.
Referenced by ConfigureClasses::addConfigFiles(), Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::defaultText(), StrQueue::erase(), Macro::expandParameter(), StrQueue::find(), Options::find(), Options::findSection(), Plugins::openPath(), relacs::operator==(), RELACSWidget::RELACSWidget(), Options::rfind(), Options::rfindSection(), Parameter::save(), Parameter::selectText(), RangeLoop::set(), ConfigureClasses::setConfigFiles(), Parameter::setDefault(), RELACSPlugin::setRELACSWidget(), Parameter::setText(), Parameter::size(), and Parameter::text().
|
inline |
True if there aren't any strings contained in the list.
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::clear(), StrQueue::find(), Plugins::openPath(), Parameter::read(), DataFile::readBlock(), Parameter::selectText(), and Parameter::setValue().
Inserts or erases elements s at the end such that the size becomes n.
Referenced by Parameter::assign(), Parameter::clear(), and Parameter::setNumbers().
|
inline |
Erases all of the strings in the list.
Referenced by Parameter::addNumber(), Parameter::addText(), StrQueue::assign(), DataFile::close(), DataFile::metaData(), Parameter::read(), Parameter::setDate(), Parameter::setDefaultDate(), Parameter::setDefaultNumber(), Parameter::setDefaultText(), Parameter::setDefaultTime(), Parameter::setTime(), DataFile::splitLine(), and relacs::translate().
|
inline |
Returns the string at index index.
|
inline |
Returns the string at index index.
int find | ( | const string & | strg, |
int | index = 0 |
||
) | const |
Return the index of the string that matches strg. If there is no matching strg -1 is returned. Searching is started at the index-th element.
References StrQueue::empty(), and StrQueue::size().
Referenced by Parameter::assign(), Options::find(), Parameter::index(), and Parameter::selectText().
|
inline |
Add string s to the end of the list.
Referenced by Parameter::addDefaultText(), Parameter::addText(), StrQueue::append(), StrQueue::assign(), StrQueue::load(), OutData::load(), DataFile::readBlock(), RELACSWidget::RELACSWidget(), Parameter::selectText(), RangeLoop::set(), DataFile::splitLine(), StrQueue::strippedComments(), and relacs::translate().
|
inline |
Insert string s at the beginning of the list.
Referenced by Parameter::selectText().
StrQueue::iterator erase | ( | iterator | pos | ) |
Erases the string at position pos.
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Options::find(), Options::findSection(), Options::rfind(), Options::rfindSection(), Parameter::selectText(), and StrQueue::strip().
void erase | ( | int | index | ) |
Erases the string at index index.
StrQueue::iterator erase | ( | iterator | first, |
iterator | last | ||
) |
Erases all strings within the range first to last exclusively.
StrQueue::iterator erase | ( | int | from, |
int | to | ||
) |
Erases all strings within the range from to to exclusively.
References StrQueue::size().
void reverse | ( | void | ) |
Reverses the order of strings in the list.
void sort | ( | void | ) |
Sort the strings in the list.
StrQueue & strip | ( | void | ) |
Remove leading and trailing empty lines.
References StrQueue::erase().
Referenced by ConfigureClasses::addConfigFiles(), Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), ConfigureClasses::read(), RELACSWidget::RELACSWidget(), Parameter::selectText(), and ConfigureClasses::setConfigFiles().
StrQueue & stripComments | ( | const string & | comment = Str::comment() | ) |
Removes comments from each string. If comment is set to 'XXX' everything behind 'XXX' inclusively is erased from each string. If comment is set to '-XXX' everything before 'XXX' inclusively is erased from each string.
Referenced by OutData::load().
StrQueue strippedComments | ( | const string & | comment = Str::comment() | ) | const |
Returns the StrQueue with comments removed. If comment is set to 'XXX' everything behind 'XXX' inclusively is erased from each string. If comment is set to '-XXX' everything before 'XXX' inclusively is erased from each string.
References StrQueue::add(), and StrQueue::StrQueue().
string save | ( | const string & | separator = " " | ) | const |
Referenced by relacs::operator<<().
istream & load | ( | istream & | str, |
const string & | stop = "" , |
||
string * | line = 0 |
||
) |
Read from stream str until end of file or a line beginning with stop is reached. If stop equals the StopEmpty string, reading is stopped at an empty line. Each line is appended to the list. If line does not equal zero then the last read line is returned in line.
References StrQueue::add(), and StrQueue::StopEmpty.
Referenced by ConfigureClasses::read().
ostream & save | ( | ostream & | str, |
const string & | start = "" |
||
) | const |
Compare two StrQueue. Returns true
if they contain the same number of strings and all of the strings are equal.
|
friend |
Write the whole StrQueue into stream str.
|
static |
Stop-string for load() to stop reading at an empty line.
Referenced by StrQueue::load(), Options::load(), and Options::read().