Subversion Repositories spk

Rev

Rev 1 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "settings.h"
#include "../common/strutils.h"

#include <stdio.h>
#include <windows.h>

static Settings *g_settings;
//---------------------------------------------------------------------------------
bool Settings::loadINI(const char *pszFileName)
{
        char szSectionName[50];
        
        g_settings=this;
        clearErrors();
        
        GetPrivateProfileStringA("library", "WriteWarnings", "off", szSectionName, sizeof(szSectionName), pszFileName);
        m_bOutputWarnings = (_stricmp(szSectionName, "on")==0);
        
        GetPrivateProfileStringA("library", "Convert", "on", szSectionName, sizeof(szSectionName), pszFileName);
        m_bRawMode =! (_stricmp(szSectionName, "on")==0);
        
        GetPrivateProfileStringA("library", "XtraPointInfo", "on", szSectionName, sizeof(szSectionName), pszFileName);
        m_bXtraPntInfo = (_stricmp(szSectionName, "on")==0);
        
        GetPrivateProfileStringA("library", "WriteX3Data", "on", szSectionName, sizeof(szSectionName), pszFileName);
        m_bWriteX3Data = (_stricmp(szSectionName, "on")==0);
        
        return true;
}
//---------------------------------------------------------------------------------
void Settings::error(ErrorType type, ErrorCodes code, const char *format, ...)
{
        va_list ap;
        va_start(ap, format);
        
        ErrorMsg *e=new ErrorMsg();
        e->type=type;
        e->code=code;
        
        _vsnprintf(e->message, sizeof(e->message), format, ap);
        va_end(ap);
        
        errors.push_back(e);
}
//---------------------------------------------------------------------------------