http and lots of formats

This commit is contained in:
2026-01-05 00:30:37 +02:00
parent 965cecc901
commit f886350eb1
23 changed files with 1727 additions and 121 deletions

View File

@@ -142,8 +142,10 @@ IINIFile *CINIManager::ReadString( const char *psz )
if (bIsQuoted)
{
// text within ""
if (bIsSlash)
{
// reading \n \t etc.
bIsSlash = false;
switch (c)
{
@@ -157,8 +159,9 @@ IINIFile *CINIManager::ReadString( const char *psz )
szStringValue.AppendTail('\n');
continue;
case 't':
szStringValue.AppendTail('\n');
szStringValue.AppendTail('\t');
continue;
// allow for strings to go to next line with by ending with backward slash
case '\n':
szStringValue.AppendTail('\n');
continue;
@@ -167,16 +170,22 @@ IINIFile *CINIManager::ReadString( const char *psz )
continue;
}
} else {
// react to special symbols witin a string
switch (c)
{
// enables reading \n \t etc.
case '\\':
bIsSlash = true;
continue;
case '\n':
// newline
// we do want to end it to prevent parsing errors
// and there is no standart
V_printf("line %i: new line was found but the string wasn't finished, did you forget to place \" in the end of the line?\n", nCurrentLine);
case '"':
// end string
bIsQuoted = false;
if (szStringValue == 0)
continue;
@@ -190,6 +199,7 @@ IINIFile *CINIManager::ReadString( const char *psz )
}
} else {
// " makes it use a string
if (c == '"')
{
bIsQuoted = true;
@@ -210,6 +220,9 @@ IINIFile *CINIManager::ReadString( const char *psz )
};
// tokenize
// shitty tokenize
// must be reworked
for ( int i = 0; i < tokens.GetSize(); i++ )
{
if (tokens[i] == "]")