Example #1
0
void Filter::save(fxfile::base::ConfFileEx &aConfFile) const
{
    xpr_sint_t         i;
    xpr_tchar_t        sKey[0xff];
    ConfFile::Section *sSection;
    FilterItem        *sFilterItem;
    FilterDeque::const_iterator sIterator;

    sSection = aConfFile.addSection(kFilterSection);
    XPR_ASSERT(sSection != XPR_NULL);

    sIterator = mFilterDeque.begin();
    for (i = 0; sIterator != mFilterDeque.end(); ++i, ++sIterator)
    {
        sFilterItem = *sIterator;
        XPR_ASSERT(sFilterItem);

        _stprintf(sKey, kNameKey, i + 1);
        aConfFile.setValueS(sSection, sKey, sFilterItem->mName);

        _stprintf(sKey, kExtensionKey, i + 1);
        aConfFile.setValueS(sSection, sKey, sFilterItem->mExts);

        _stprintf(sKey, kColorKey, i + 1);
        aConfFile.setValueC(sSection, sKey, sFilterItem->mColor);

        _stprintf(sKey, kIconIndexKey, i + 1);
        aConfFile.setValueI(sSection, sKey, sFilterItem->mIconIndex);
    }
}
Example #2
0
void RecentFileList::save(fxfile::base::ConfFileEx &aConfFile) const
{
    xpr_sint_t         i;
    xpr_tchar_t        sKey[XPR_MAX_PATH + 1];
    ConfFile::Section *sSection;
    FileDeque::const_iterator sIterator;

    sSection = aConfFile.addSection(kRecentFileListSection);
    XPR_ASSERT(sSection != XPR_NULL);

    sIterator = mFileDeque.begin();
    for (i = 0; sIterator != mFileDeque.end(); ++sIterator, ++i)
    {
        const xpr::string &sPath = *sIterator;

        _stprintf(sKey, kFileKey, i + 1);

        aConfFile.setValueS(sSection, sKey, sPath);
    }
}
Example #3
0
void ProgramAss::save(fxfile::base::ConfFileEx &aConfFile) const
{
    xpr_sint_t         i;
    xpr_tchar_t        sKey[0xff];
    ConfFile::Section *sSection;
    ProgramAssItem    *sProgramAssItem;
    ProgramAssDeque::const_iterator sIterator;

    sSection = aConfFile.addSection(kProgramAssSection);
    XPR_ASSERT(sSection != XPR_NULL);

    sIterator = mProgramAssDeque.begin();
    for (i = 0; sIterator != mProgramAssDeque.end(); ++sIterator, ++i)
    {
        sProgramAssItem = *sIterator;
        XPR_ASSERT(sProgramAssItem != XPR_NULL);

        _stprintf(sKey, kNameKey, i + 1);
        aConfFile.setValueS(sSection, sKey, sProgramAssItem->mName);

        _stprintf(sKey, kTypeKey, i + 1);
        aConfFile.setValueI(sSection, sKey, sProgramAssItem->mType);

        _stprintf(sKey, kMethodKey, i + 1);
        aConfFile.setValueI(sSection, sKey, sProgramAssItem->mMethod);

        if (sProgramAssItem->mMethod == ProgramAssMethodExt)
        {
            _stprintf(sKey, kExtensionKey, i + 1);
            aConfFile.setValueS(sSection, sKey, sProgramAssItem->mExts);
        }
        else
        {
            _stprintf(sKey, kFilterKey, i + 1);
            aConfFile.setValueS(sSection, sKey, sProgramAssItem->mFilterName);
        }

        _stprintf(sKey, kProgramKey, i + 1);
        aConfFile.setValueS(sSection, sKey, sProgramAssItem->mPath);
    }
}