1
0

Added the new recipe parser, parsing the crafting.txt file. Included are a few recipes. The old parser still works, but will be replaced soon.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@549 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-06-04 12:08:20 +00:00
parent ce5d97d65b
commit b355bdecce
21 changed files with 20029 additions and 18948 deletions

View File

@@ -88,10 +88,7 @@ AStringVector StringSplit(const AString & str, const AString & delim)
size_t Prev = 0;
while ((cutAt = str.find_first_of(delim, Prev)) != str.npos)
{
if (cutAt > 0)
{
results.push_back(str.substr(Prev, cutAt - Prev));
}
results.push_back(str.substr(Prev, cutAt - Prev));
Prev = cutAt + delim.length();
}
if (Prev < str.length())
@@ -104,6 +101,40 @@ AStringVector StringSplit(const AString & str, const AString & delim)
AString TrimString(const AString & str)
{
size_t len = str.length();
size_t start = 0;
while (start < len)
{
if (str[start] > 32)
{
break;
}
++start;
}
if (start == len)
{
return "";
}
size_t end = len;
while (end >= start)
{
if (str[end] > 32)
{
break;
}
--end;
}
return str.substr(start, end - start + 1);
}
AString & StrToUpper(AString & s)
{
AString::iterator i = s.begin();