예제 #1
0
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();
}
예제 #2
0
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);
    }
}
예제 #3
0
파일: common.cpp 프로젝트: sr105/kdiff3
QString     ValueMap::readEntry (const QString& s, const char* defaultVal ) { return readStringEntry(s, QString::fromLatin1(defaultVal) ); }
예제 #4
0
파일: common.cpp 프로젝트: sr105/kdiff3
QString     ValueMap::readEntry (const QString& s, const QString& defaultVal ) { return readStringEntry(s, defaultVal); }
예제 #5
0
static gboolean readBoolEntry(GHashTable *cfg, char *key, gboolean def)
{
    char *str=readStringEntry(cfg, key);

    return str ? (0==memcmp(str, "true", 4) ? true : false) : def;
}
예제 #6
0
static int readNumEntry(GHashTable *cfg, char *key, int def)
{
    char *str=readStringEntry(cfg, key);

    return str ? atoi(str) : def;
}