diff options
author | Slávek Banko <[email protected]> | 2013-07-27 16:57:53 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-07-27 18:48:46 +0200 |
commit | 7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931 (patch) | |
tree | 4655c7263ca5c64d23d10167cb459dd9cb253815 /src/arkollon/rcparser.cpp | |
parent | 88ea2b6cd4382627fb6efca9cc54825aee881d1e (diff) | |
download | tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.tar.gz tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.zip |
Initial TQt conversion
Diffstat (limited to 'src/arkollon/rcparser.cpp')
-rw-r--r-- | src/arkollon/rcparser.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/arkollon/rcparser.cpp b/src/arkollon/rcparser.cpp index dc9442f..82123dc 100644 --- a/src/arkollon/rcparser.cpp +++ b/src/arkollon/rcparser.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "rcparser.h" -#include <qregexp.h> -#include <qfile.h> -#include <qtextstream.h> +#include <ntqregexp.h> +#include <ntqfile.h> +#include <ntqtextstream.h> RcParser::RcParser() { @@ -32,18 +32,18 @@ RcParser::~RcParser() { } -void RcParser::addSearchDir(QString dir) +void RcParser::addSearchDir(TQString dir) { dirs.append(dir); } -bool RcParser::openFile(QString name) +bool RcParser::openFile(TQString name) { // Check if it exists fileName = ""; - for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) + for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) { - if (QFile::exists((*it) + "/" + name)) + if (TQFile::exists((*it) + "/" + name)) { fileName = (*it) + "/" + name; break; @@ -57,17 +57,17 @@ bool RcParser::openFile(QString name) sections.clear(); // Read the file's contents - QFile file(fileName); + TQFile file(fileName); file.open(IO_ReadOnly); - QTextStream stream(&file); + TQTextStream stream(&file); - QRegExp sectionRegExp("^\\[([^\\]]*)\\]$"); - QRegExp pairRegExp("^([^=\\s]*)([=\\s]*)(.*)$"); + TQRegExp sectionRegExp("^\\[([^\\]]*)\\]$"); + TQRegExp pairRegExp("^([^=\\s]*)([=\\s]*)(.*)$"); currentSection = "RcParserDefaultSection"; while (!stream.atEnd()) { - QString line = stream.readLine(); + TQString line = stream.readLine(); if (line.left(1) == "#") // Comment continue; @@ -81,8 +81,8 @@ bool RcParser::openFile(QString name) } if (pairRegExp.search(line) != -1) { - QString key = pairRegExp.cap(1); - QString value = pairRegExp.cap(3); + TQString key = pairRegExp.cap(1); + TQString value = pairRegExp.cap(3); sections[currentSection][key] = value; //printf("Found pair \"%s\" = \"%s\"\n", key.latin1(), value.latin1()); continue; @@ -95,25 +95,25 @@ bool RcParser::openFile(QString name) return true; } -void RcParser::setSection(QString section) +void RcParser::setSection(TQString section) { currentSection = section; } -QStringList RcParser::sectionList() +TQStringList RcParser::sectionList() { return sections.keys(); } -QString RcParser::readString(QString key, QString def) +TQString RcParser::readString(TQString key, TQString def) { - QString ret = sections[currentSection][key]; + TQString ret = sections[currentSection][key]; if (ret.isEmpty()) return def; return ret; } -int RcParser::readInt(QString key, int def) +int RcParser::readInt(TQString key, int def) { bool ok; int ret = sections[currentSection][key].toInt(&ok); @@ -122,7 +122,7 @@ int RcParser::readInt(QString key, int def) return ret; } -bool RcParser::readBool(QString key, bool def) +bool RcParser::readBool(TQString key, bool def) { bool ret = def; if (sections[currentSection][key].lower() == "true") @@ -136,9 +136,9 @@ bool RcParser::readBool(QString key, bool def) return ret; } -QStringList RcParser::readList(QString key) +TQStringList RcParser::readList(TQString key) { - return QStringList::split(",", sections[currentSection][key]); + return TQStringList::split(",", sections[currentSection][key]); } |