Brief description of class still missing. More...
#include <LineParser.h>
Public Member Functions | |
int | count () |
const QString & | delimiters () const |
int | endsAt (int index, bool &ok) |
LineParser () | |
LineParser (const QString &str) | |
LineParser (const StringSection &str) | |
void | setDelimiters (const QString &d) |
void | setSkipEmpty (bool s) |
void | setString (const QString &str) |
void | setString (const StringSection &str) |
bool | skipEmpty () const |
int | startsAt (int index, bool &ok) |
bool | toBool (int index, bool &ok) |
double | toDouble (int index, bool &ok) |
int | toInt (int index, bool &ok, int base=10) |
qlonglong | toLongLong (int index, bool &ok, int base=10) |
QString | toString (int index, bool &ok) |
QString | toString (int indexBegin, int indexEnd, bool &ok) |
uint | toUInt (int index, bool &ok, int base=10) |
const StringSection & | value (int index) |
~LineParser () |
Brief description of class still missing.
Full description of class still missing
Description of constructor still missing
References QGpCoreTools::StringSection::defaultSeparators, and TRACE.
{ TRACE; _ptr=0; _delimiters=StringSection::defaultSeparators; _skipEmpty=true; }
QGpCoreTools::LineParser::LineParser | ( | const QString & | str | ) |
Description of constructor still missing
References QGpCoreTools::StringSection::defaultSeparators, QGpCoreTools::StringSection::set(), str, and TRACE.
{ TRACE; _str=str; _strSection.set(_str); _ptr=0; _delimiters=StringSection::defaultSeparators; _skipEmpty=true; }
QGpCoreTools::LineParser::LineParser | ( | const StringSection & | str | ) |
Description of constructor still missing
References QGpCoreTools::StringSection::defaultSeparators, str, and TRACE.
{ TRACE; _strSection=str; _ptr=0; _delimiters=StringSection::defaultSeparators; _skipEmpty=true; }
QGpCoreTools::LineParser::~LineParser | ( | ) | [inline] |
{}
int QGpCoreTools::LineParser::count | ( | ) |
Parses all and returns number of items
References QGpCoreTools::StringSection::null, and TRACE.
Referenced by SciFigs::CircleViewer::add(), HeaderMap::map(), CoordReader::parse(), Acquisition::read(), CoordReader::setOptions(), and GeopsyCore::WindowingParameters::setValue().
{ TRACE; int index=_values.count(); while(parse(index)!=StringSection::null) { index++; } return _values.count(); }
const QString& QGpCoreTools::LineParser::delimiters | ( | ) | const [inline] |
{return _delimiters;}
int QGpCoreTools::LineParser::endsAt | ( | int | index, |
bool & | ok | ||
) |
Returns the last character index of column index.
References QGpCoreTools::StringSection::data(), QGpCoreTools::StringSection::isValid(), QGpCoreTools::StringSection::size(), TRACE, and value().
Referenced by TimeReader::parse().
void QGpCoreTools::LineParser::setDelimiters | ( | const QString & | d | ) | [inline] |
Referenced by EventListModel::load(), TimeReader::parse(), Acquisition::read(), RecordList::read(), RecordList::setSupplierEquivalences(), and GeopsyCore::WindowingParameters::setValue().
{_delimiters=d;}
void QGpCoreTools::LineParser::setSkipEmpty | ( | bool | s | ) | [inline] |
Referenced by Acquisition::read(), RecordList::read(), and RecordList::setSupplierEquivalences().
{_skipEmpty=s;}
void QGpCoreTools::LineParser::setString | ( | const QString & | str | ) |
References QGpCoreTools::StringSection::set(), str, and TRACE.
Referenced by EventListModel::load(), main(), Acquisition::read(), Schedule::read(), WaranGpsWidget::setGpsStations(), CoordReader::setOptions(), and RecordList::setSupplierEquivalences().
void QGpCoreTools::LineParser::setString | ( | const StringSection & | str | ) |
bool QGpCoreTools::LineParser::skipEmpty | ( | ) | const [inline] |
{return _skipEmpty;}
int QGpCoreTools::LineParser::startsAt | ( | int | index, |
bool & | ok | ||
) |
Returns the first character index of column index.
References QGpCoreTools::StringSection::data(), QGpCoreTools::StringSection::isValid(), TRACE, and value().
Referenced by TimeReader::parse().
bool QGpCoreTools::LineParser::toBool | ( | int | index, |
bool & | ok | ||
) | [inline] |
References QGpCoreTools::StringSection::isValid(), QGpCoreTools::StringSection::toBool(), and value().
{ const StringSection& v=value(index); if(v.isValid()) { return v.toBool(); } else { ok=false; return true; } }
double QGpCoreTools::LineParser::toDouble | ( | int | index, |
bool & | ok | ||
) | [inline] |
References QGpCoreTools::StringSection::toDouble(), and value().
Referenced by SciFigs::CircleViewer::add(), createText(), main(), CoordReader::parse(), Measurement::set(), and CoordReader::setOptions().
int QGpCoreTools::LineParser::toInt | ( | int | index, |
bool & | ok, | ||
int | base = 10 |
||
) | [inline] |
References QGpCoreTools::StringSection::toInt(), and value().
Referenced by SciFigs::CircleViewer::add().
qlonglong QGpCoreTools::LineParser::toLongLong | ( | int | index, |
bool & | ok, | ||
int | base = 10 |
||
) | [inline] |
References QGpCoreTools::StringSection::toLongLong(), and value().
{ if(ok) { return value(index).toLongLong(&ok, base); } else { return 0; } }
QString QGpCoreTools::LineParser::toString | ( | int | index, |
bool & | ok | ||
) | [inline] |
References QGpCoreTools::StringSection::isValid(), QGpCoreTools::StringSection::toString(), and value().
Referenced by Schedule::init(), EventListModel::load(), main(), HeaderMap::map(), TimeReader::parse(), CoordReader::parse(), WaranGpsWidget::setGpsStations(), CoordReader::setOptions(), RecordList::setSupplierEquivalences(), GeopsyCore::WindowingParameters::setValue(), and toString().
{ const StringSection& v=value(index); if(v.isValid()) { return v.toString(); } else { ok=false; return QString::null; } }
QString QGpCoreTools::LineParser::toString | ( | int | indexBegin, |
int | indexEnd, | ||
bool & | ok | ||
) |
Returns all available columns between indexBegin and indexEnd. ok is set to false only if no column is available.
References QGpCoreTools::StringSection::begin(), QGpCoreTools::StringSection::end(), QGpCoreTools::StringSection::isValid(), toString(), and value().
{ const StringSection& vBegin=value(indexBegin); if(!vBegin.isValid()) { ok=false; return QString::null; } const StringSection& vEnd=value(indexEnd); if(vEnd.isValid()) { return StringSection(vBegin.begin(), vEnd.end()).toString(); } else { return StringSection(vBegin.begin(), _values.last().end()).toString(); } }
uint QGpCoreTools::LineParser::toUInt | ( | int | index, |
bool & | ok, | ||
int | base = 10 |
||
) | [inline] |
References QGpCoreTools::StringSection::toUInt(), and value().
const StringSection & QGpCoreTools::LineParser::value | ( | int | index | ) | [inline] |
Referenced by endsAt(), startsAt(), toBool(), toDouble(), toInt(), toLongLong(), toString(), and toUInt().
{ if(index<_values.count()) return _values.at(index); return parse(index); }