mirror of
https://github.com/cmosher01/Epple-II.git
synced 2025-01-03 01:33:45 +00:00
remove std::transform (too new)
This commit is contained in:
parent
76cc7992a9
commit
ef0748d81d
@ -36,6 +36,8 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
|
||||
#define K 1024u
|
||||
@ -195,6 +197,13 @@ void Config::parseLine(const std::string& line, MemoryRandomAccess& ram, Memory&
|
||||
}
|
||||
}
|
||||
|
||||
static std::string filter_row(const std::string &row) {
|
||||
if (row.length() != 1) {
|
||||
return "";
|
||||
}
|
||||
return std::string(1, static_cast<char>(std::toupper(row[0])));
|
||||
}
|
||||
|
||||
void Config::tryParseLine(const std::string& line, MemoryRandomAccess& ram, Memory& rom, Slots& slts, int& revision, ScreenImage& gui, CassetteIn& cassetteIn, CassetteOut& cassetteOut)
|
||||
{
|
||||
std::istringstream tok(line);
|
||||
@ -220,7 +229,7 @@ void Config::tryParseLine(const std::string& line, MemoryRandomAccess& ram, Memo
|
||||
*/
|
||||
std::string row;
|
||||
tok >> row;
|
||||
std::transform(row.begin(), row.end(), row.begin(), ::toupper);
|
||||
row = filter_row(row);
|
||||
if (row != "C" && row != "D" && row != "E") {
|
||||
throw ConfigException("expected row to be C, D, or E");
|
||||
}
|
||||
@ -248,7 +257,7 @@ void Config::tryParseLine(const std::string& line, MemoryRandomAccess& ram, Memo
|
||||
*/
|
||||
std::string row;
|
||||
tok >> row;
|
||||
std::transform(row.begin(), row.end(), row.begin(), ::toupper);
|
||||
row = filter_row(row);
|
||||
if (row != "C" && row != "D" && row != "E") {
|
||||
throw ConfigException("expected row to be C, D, or E");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user