ulong CConfig::readNumberEntry(const QString & key, ulong def) { #ifdef DEBUG qDebug("CConfig::readNumberEntry('%s', %d)", debug_string(key), def); #endif return readStringEntry(key, QString::number(def)).toULong(); }
void GPDBase::init() { // read all the images for (DWORD i = 0; i < xdbf->images.size(); i++) { // set up the information ImageEntry image; image.entry = xdbf->images.at(i); image.initialLength = image.length = image.entry.length; image.image = new BYTE[image.length]; // read in the image io->setPosition(xdbf->GetRealAddress(image.entry.addressSpecifier)); io->readBytes(image.image, image.length); // add the image to the vector images.push_back(image); } // read all the settings for (DWORD i = 0; i < xdbf->settings.entries.size(); i++) settings.push_back(readSettingEntry(xdbf->settings.entries.at(i))); // read all the strings for (DWORD i = 0; i < xdbf->strings.size(); i++) { // read in the string entry StringEntry entry; entry.entry = xdbf->strings.at(i); entry.ws = readStringEntry(entry.entry); entry.initialLength = entry.ws.length(); // add the entry to the vector strings.push_back(entry); } }
QString ValueMap::readEntry (const QString& s, const char* defaultVal ) { return readStringEntry(s, QString::fromLatin1(defaultVal) ); }
QString ValueMap::readEntry (const QString& s, const QString& defaultVal ) { return readStringEntry(s, defaultVal); }
static gboolean readBoolEntry(GHashTable *cfg, char *key, gboolean def) { char *str=readStringEntry(cfg, key); return str ? (0==memcmp(str, "true", 4) ? true : false) : def; }
static int readNumEntry(GHashTable *cfg, char *key, int def) { char *str=readStringEntry(cfg, key); return str ? atoi(str) : def; }