Exemplo n.º 1
0
void ReadMixedItem(CCfgCalc*& tReader, const TCHAR* sTitle, bool bCanEmpty,
                   const string& tDefault)
{
    SetItemTitle(sTitle);
    string sValue = g_pTabFile->GetString(g_iLine, sTitle);
    trimend(sValue);
    CheckEmpty(tReader, sValue, bCanEmpty, tDefault);
    if(!sValue.empty())
    {
        SetValue(tReader, sValue, false);
    }
}
Exemplo n.º 2
0
void ReadItem(string& tReader, const TCHAR* sTitle, bool bCanEmpty,
              const string& tDefault, FIELD_CHECKER_STRING pFunFieldChecker)
{
    SetItemTitle(sTitle);
    string sValue = g_pTabFile->GetString(g_iLine, sTitle);
    size_t l = sValue.size();
    if(l > 1 && sValue[0] == '"' && sValue[l - 1] == '"') sValue = sValue.substr(1, l - 2);
    trimend(sValue);
    CheckEmpty(tReader, sValue, bCanEmpty, tDefault);
    if(!sValue.empty())
    {
        SetValue(tReader, sValue);
    }
    CheckField(tReader, pFunFieldChecker);
}
Exemplo n.º 3
0
void ReadItem(uint32& tReader, const TCHAR* sTitle, bool bCanEmpty,
              uint32 tDefault, FIELD_CHECKER pFunFieldChecker, uint32 fFieldCheckerParam)
{
    SetItemTitle(sTitle);
    string sValue = g_pTabFile->GetString(g_iLine, sTitle);
    CheckEmpty(tReader, sValue, bCanEmpty, tDefault);
    if(!sValue.empty())
    {
        int32 tTempReader;
        SetValue(tTempReader, sValue);
        CheckUIntType(tTempReader);
        tReader = tTempReader;
    }
    CheckField(tReader, pFunFieldChecker, fFieldCheckerParam);
}
Exemplo n.º 4
0
void ReadItem(CCfgCalc*& tReader, const TCHAR* sTitle, bool bCanEmpty,
              float tDefault, FIELD_CHECKER pFunFieldChecker, float fFieldCheckerParam)
{
    SetItemTitle(sTitle);
    string sValue = g_pTabFile->GetString(g_iLine, sTitle);
    trimend(sValue);
    CheckEmpty(tReader, sValue, bCanEmpty, tDefault);
    if(!sValue.empty())
    {
        SetValue(tReader, sValue);
    }
    if(pFunFieldChecker && tReader->IsSingleNumber())
    {
        float fTemp = float(tReader->GetDblValue());
        CheckField(fTemp, pFunFieldChecker, fFieldCheckerParam);
    }
}
Exemplo n.º 5
0
DMListAttribute::DMListAttribute(
	LStream*	inStream)

: DMContainerAttribute(inStream)

{

	// Read stream data.

	Str255 subItemTitle;
	SInt8 flags;
	
	(*inStream)	>> subItemTitle
				>> mCountSize
				>> flags;

	// Set title and flags.

	SetItemTitle(subItemTitle);

	mZeroBasedCount = (flags & 0x01) != 0;
	mZeroBasedIndex = (flags & 0x02) != 0;

}
Exemplo n.º 6
0
void ReadItem(string& tReader, const TCHAR* sTitle,
              FIELD_CHECKER_STRING pFunFieldChecker)
{
    SetItemTitle(sTitle);
    ReadItem(tReader, sTitle, false, "", pFunFieldChecker);
}