Exemplo n.º 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);
    }
}
Exemplo n.º 2
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);
    }
}