26 #include <QtCore/QDir>
27 #include <QtCore/QFile>
28 #include <QtCore/QStringList>
29 #include <QtCore/QTextStream>
47 return "SgNetworkStnRecord";
83 code_ = str.mid(1, 2);
84 name_ = str.mid(4, 8).simplified();
85 name_.replace(
'_',
' ');
114 return "SgNetworkStations";
128 "::readFile(): the ns-codes file [" + fName +
129 "] does not exist; ns-code records are unavailable");
130 return (
isOk_=
false);
133 if (f.open(QFile::ReadOnly))
140 if (str.size()>29 && str.at(0)==
' ' && rec.
parseString(str))
144 "::readFile(): got a duplicate record \"" + str +
145 "\" for the station name \"" + rec.
getName() +
"\" in the ns-codes file [" + fName +
"]");
151 "::readFile(): got a duplicate record \"" + str +
152 "\" for the station code \"" + rec.
getCode() +
"\" in the ns-codes file [" + fName +
"]");
164 "::readFile(): extracted " + QString(
"").setNum(
recByName_.size()) +
165 " records from the ns-codes file [" + fName +
"]");
virtual void write(LogLevel, quint32, const QString &, bool=false)
const SgNetworkStnRecord & lookUp(const QString &)
static const QString className()
QMultiMap< QString, SgNetworkStnRecord > recById_
QMultiMap< QString, SgNetworkStnRecord > recByName_
bool parseString(const QString &)
const QString & getName() const
SgNetworkStnRecord & operator=(const SgNetworkStnRecord &r)
static const QString className()
const QString & getCode() const