1
0

Added water and lava springs.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1269 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-03-14 09:52:57 +00:00
parent e18e539ad2
commit ff403fdbf0
11 changed files with 520 additions and 11 deletions

View File

@@ -118,6 +118,26 @@ AStringVector StringSplit(const AString & str, const AString & delim)
AStringVector StringSplitAndTrim(const AString & str, const AString & delim)
{
AStringVector results;
size_t cutAt = 0;
size_t Prev = 0;
while ((cutAt = str.find_first_of(delim, Prev)) != str.npos)
{
results.push_back(TrimString(str.substr(Prev, cutAt - Prev)));
Prev = cutAt + delim.length();
}
if (Prev < str.length())
{
results.push_back(TrimString(str.substr(Prev)));
}
return results;
}
AString TrimString(const AString & str)
{
size_t len = str.length();
@@ -506,7 +526,11 @@ AString & CreateHexDump(AString & a_Out, const void * a_Data, int a_Size, int a_
k = a_LineLength;
}
memset(line, ' ', sizeof(line));
#ifdef _MSC_VER // MSVC provides a "secure" version of sprintf()
line[sprintf_s(line, sizeof(line), "%08x:", i)] = 32; // Remove the terminating NULL that sprintf puts there
#else
line[sprintf(line, "%08x:", i)] = 32; // Remove the terminating NULL that sprintf puts there
#endif
p = line + 10;
q = p + 2 + a_LineLength * 3 + 1;
for (int j = 0; j < k; j++)