Ares
Static Public Member Functions | Static Public Attributes

IniSectionIncludes Class Reference

#include <src/Misc/IniSectionIncludes.h>

List of all members.

Static Public Member Functions

static CCINIClass::INISection * PreProcess (CCINIClass *ini, char *str)
static void CopySection (CCINIClass *ini, INIClass::INISection *source, const char *dest)

Static Public Attributes

static INIClass::INISection * includedSection = NULL

Member Function Documentation

void IniSectionIncludes::CopySection ( CCINIClass *  ini,
INIClass::INISection *  source,
const char *  dest 
) [static]
{
        //browse through section entries and copy them over to the new section
        for(GenericNode* node = &source->Entries.First; node; node = node->Next)
        {
                if(*((unsigned int*)node) == 0x7EB734) //type check via vtable address comparison... is there a better way?
                {
                        INIClass::INIEntry* entry = (INIClass::INIEntry*)node;
                        ini->WriteString(destName, entry->Key, entry->Value); //simple but effective
                }
        }
}
CCINIClass::INISection * IniSectionIncludes::PreProcess ( CCINIClass *  ini,
char *  str 
) [static]
{
        char* split = strchr(str, ':');
        if(split)
        {
                //inclusion operator detected, make sure there's a valid section definiton after that
                *split++ = 0;
                if(*split == '[')
                {
                        split++;

                        char* includedNameEnd = strchr(split, ']');
                        if(includedNameEnd && includedNameEnd != split)
                        {
                                *includedNameEnd = 0;
                                return ini->GetSection(split);
                        }
                }
        }
        return NULL;
}

Member Data Documentation

INIClass::INISection * IniSectionIncludes::includedSection = NULL [static]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines