core/CTextParsers.cpp
changeset 272 f8481df956a7
parent 208 afa8c8850b38
child 336 3f4073018d76
     1.1 --- a/core/CTextParsers.cpp	Sat Jan 06 07:53:34 2007 +0000
     1.2 +++ b/core/CTextParsers.cpp	Sat Jan 06 07:53:56 2007 +0000
     1.3 @@ -6,7 +6,7 @@
     1.4  #include <assert.h>
     1.5  #include "CTextParsers.h"
     1.6  
     1.7 -CTextParsers g_TextParse;
     1.8 +CTextParsers g_TextParser;
     1.9  
    1.10  static int g_ini_chartable1[255] = {0};
    1.11  static int g_ws_chartable[255] = {0};
    1.12 @@ -898,3 +898,28 @@
    1.13  
    1.14  	return false;
    1.15  }
    1.16 +
    1.17 +const char *CTextParsers::GetSMCErrorString(SMCParseError err)
    1.18 +{
    1.19 +	static const char *s_errors[] = 
    1.20 +	{
    1.21 +		NULL,
    1.22 +		"Stream failed to open",
    1.23 +		"Stream returned read error",
    1.24 +		NULL,
    1.25 +		"Un-quoted section has invalid tokens",
    1.26 +		"Section declared without header",
    1.27 +		"Section declared with unknown tokens",
    1.28 +		"Section ending without a matching section beginning",
    1.29 +		"Line contained too many invalid tokens",
    1.30 +		"Token buffer overflowed",
    1.31 +		"A property was declared outside of a section",
    1.32 +	};
    1.33 +
    1.34 +	if (err < SMCParse_Okay || err > SMCParse_InvalidProperty1)
    1.35 +	{
    1.36 +		return NULL;
    1.37 +	}
    1.38 +
    1.39 +	return s_errors[err];
    1.40 +}