26 #include <QtCore/QDir>
27 #include <QtCore/QFile>
28 #include <QtCore/QStringList>
29 #include <QtCore/QTextStream>
46 return "SgMasterRecord";
72 if (str.at(0) != QChar(
'|') ||
73 str.at(str.size()-1)!=QChar(
'|') ||
74 str.count(QChar(
'|')) != 16)
81 QStringList fields = str.split(
"|");
82 name_ = fields.at(1).simplified();
83 code_ = fields.at(2).simplified();
84 date_ = fields.at(3).simplified();
86 dbcCode_ = fields.at(12).simplified();
103 "::lookupRecordByName(): the masterfile directory [" + path +
104 "] does not exist; master file records are unavailable");
108 QString sYear(nickName.mid(0, 2));
109 QString sDate(nickName.mid(2, 5));
110 QString sCode(nickName.mid(7, 2));
111 if (
findRecordByName(sDate, sCode, path +
"/" +
"master" + sYear +
"-loc.txt") ||
113 findRecordByName(sDate, sCode, path +
"/" +
"master" + sYear +
"-int.txt") ||
114 findRecordByName(sDate, sCode, path +
"/" +
"master" + sYear +
"-vgos.txt") )
123 const QString& fileName)
131 "::findRecordByName(): the masterfile [" + fileName +
"] does not exist");
135 if (f.open(QFile::ReadOnly))
169 "::lookupRecordByCode(): the masterfile directory [" + path +
170 "] does not exist; master file records are unavailable");
173 if (
findRecordByCode(sessionCode, path +
"/" +
"master" + sYear +
"-loc.txt") ||
175 findRecordByCode(sessionCode, path +
"/" +
"master" + sYear +
"-int.txt") ||
176 findRecordByCode(sessionCode, path +
"/" +
"master" + sYear +
"-vgos.txt") )
192 "::findRecordByCode(): the masterfile [" + fileName +
"] does not exist");
196 if (f.open(QFile::ReadOnly))
199 "::findRecordByCode(): processing the masterfile " + fileName);
207 if (mr.
getCode() == sessionCode.toUpper())
virtual void write(LogLevel, quint32, const QString &, bool=false)
const QString & getDate() const
static const QString className()
bool lookupRecordByCode(const QString &sessionCode, const QString &sYear, const QString &path)
bool findRecordByCode(const QString &sessionCode, const QString &fileName)
const QString & getCode() const
SgMasterRecord & operator=(const SgMasterRecord &r)
void parseString(const QString &)
bool findRecordByName(const QString &date, const QString &dbcCode, const QString &fileName)
const QString & getDbcCode() const
bool lookupRecordByName(const QString &nickName, const QString &path)