- Ja llig correctament el mapa en format text
This commit is contained in:
@@ -9,9 +9,20 @@ namespace textfile
|
||||
int fsize = 0;
|
||||
int p = 0;
|
||||
|
||||
const int toInt(std::string token)
|
||||
{
|
||||
int value = 0;
|
||||
for (std::size_t i=0; i<token.length(); ++i)
|
||||
{
|
||||
if (token[i]<48 || token[i]>57) return 0;
|
||||
value = (value*10) + (token[i]-48);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
const bool open(std::string filename)
|
||||
{
|
||||
buffer = file::getFileBuffer(filename.c_str());
|
||||
buffer = file::getFileBuffer(filename.c_str(), &fsize);
|
||||
p = 0;
|
||||
|
||||
return true;
|
||||
@@ -52,6 +63,6 @@ namespace textfile
|
||||
|
||||
const int getIntValue(std::string token)
|
||||
{
|
||||
return std::stoi(getStringValue(token));
|
||||
return toInt(getStringValue(token));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user