aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/Tokenizer.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-19 15:25:32 +0200
committerMax Kellermann <max@duempel.org>2013-10-19 15:36:47 +0200
commitb39ab76118067fe6e7cb83afb176dcef4c936d3d (patch)
tree529201bb86cdf2c0f3d142aecbb2ace5209b6b89 /src/util/Tokenizer.cxx
parent90777f78c99774023e694bef5933da88d74f4d45 (diff)
downloadmpd-b39ab76118067fe6e7cb83afb176dcef4c936d3d.tar.gz
mpd-b39ab76118067fe6e7cb83afb176dcef4c936d3d.tar.xz
mpd-b39ab76118067fe6e7cb83afb176dcef4c936d3d.zip
Util/CharUtil: new library replacing g_ascii_isX()
Diffstat (limited to 'src/util/Tokenizer.cxx')
-rw-r--r--src/util/Tokenizer.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/util/Tokenizer.cxx b/src/util/Tokenizer.cxx
index 726da0dd6..1c8af23fd 100644
--- a/src/util/Tokenizer.cxx
+++ b/src/util/Tokenizer.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "Tokenizer.hxx"
+#include "CharUtil.hxx"
#include "StringUtil.hxx"
#include "Error.hxx"
#include "Domain.hxx"
@@ -33,13 +34,13 @@ static constexpr Domain tokenizer_domain("tokenizer");
static inline bool
valid_word_first_char(char ch)
{
- return g_ascii_isalpha(ch);
+ return IsAlphaASCII(ch);
}
static inline bool
valid_word_char(char ch)
{
- return g_ascii_isalnum(ch) || ch == '_';
+ return IsAlphaNumericASCII(ch) || ch == '_';
}
char *
@@ -61,7 +62,7 @@ Tokenizer::NextWord(Error &error)
whitespace or end-of-string */
while (*++input != 0) {
- if (g_ascii_isspace(*input)) {
+ if (IsWhitespaceOrNull(*input)) {
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
@@ -106,7 +107,7 @@ Tokenizer::NextUnquoted(Error &error)
whitespace or end-of-string */
while (*++input != 0) {
- if (g_ascii_isspace(*input)) {
+ if (IsWhitespaceOrNull(*input)) {
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
@@ -170,7 +171,7 @@ Tokenizer::NextString(Error &error)
line) */
++input;
- if (*input != 0 && !g_ascii_isspace(*input)) {
+ if (!IsWhitespaceOrNull(*input)) {
error.Set(tokenizer_domain,
"Space expected after closing '\"'");
return nullptr;