diff options
author | Max Horn | 2010-10-15 12:19:13 +0000 |
---|---|---|
committer | Max Horn | 2010-10-15 12:19:13 +0000 |
commit | 36cd5caf956c087995a62983ad09c15250f29475 (patch) | |
tree | 39dc6b202fb711fef28bc7f7c49bb7611232af83 /backends/vkeybd | |
parent | f52b31a05f9b234a367dd83b89cceaa3d9848204 (diff) | |
download | scummvm-rg350-36cd5caf956c087995a62983ad09c15250f29475.tar.gz scummvm-rg350-36cd5caf956c087995a62983ad09c15250f29475.tar.bz2 scummvm-rg350-36cd5caf956c087995a62983ad09c15250f29475.zip |
COMMON: Add XMLParser::parseIntegerKey variant accepting a Common::String
Almost all places where we used XMLParser::parseIntegerKey were using
it like this:
XMLParser::parseIntegerKey(str.c_str(), ...)
Since this makes the code harder to read, I overloaded the method to
also accept Commmon::String directly.
Also removed all .c_str() invocations where necessary.
svn-id: r53479
Diffstat (limited to 'backends/vkeybd')
-rw-r--r-- | backends/vkeybd/virtual-keyboard-parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp index 6a644e0cdf..dd11866262 100644 --- a/backends/vkeybd/virtual-keyboard-parser.cpp +++ b/backends/vkeybd/virtual-keyboard-parser.cpp @@ -270,7 +270,7 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) { int r, g, b; if (node->values.contains("transparent_color")) { - if (!parseIntegerKey(node->values["transparent_color"].c_str(), 3, &r, &g, &b)) + if (!parseIntegerKey(node->values["transparent_color"], 3, &r, &g, &b)) return parserError("Could not parse color value"); } else { // default to purple @@ -281,7 +281,7 @@ bool VirtualKeyboardParser::parserCallback_layout(ParserNode *node) { _mode->transparentColor = format.RGBToColor(r, g, b); if (node->values.contains("display_font_color")) { - if (!parseIntegerKey(node->values["display_font_color"].c_str(), 3, &r, &g, &b)) + if (!parseIntegerKey(node->values["display_font_color"], 3, &r, &g, &b)) return parserError("Could not parse color value"); } else { r = g = b = 0; // default to black @@ -336,7 +336,7 @@ byte VirtualKeyboardParser::parseFlags(const String& flags) { bool VirtualKeyboardParser::parseRect(Rect &rect, const String& coords) { int x1, y1, x2, y2; - if (!parseIntegerKey(coords.c_str(), 4, &x1, &y1, &x2, &y2)) + if (!parseIntegerKey(coords, 4, &x1, &y1, &x2, &y2)) return parserError("Invalid coords for rect area"); rect.left = x1; rect.top = y1; |