Commit 4f52f60b authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Inline some single character categorization functions

parent 5afc2562
......@@ -66,16 +66,6 @@ const char DEFAULT_STRIP_CHARSET[] = "\r\n\t ";
const char UPPER_XDIGITS[] = "0123456789ABCDEF";
bool isAlpha(const char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
bool isDigit(const char c) { return '0' <= c && c <= '9'; }
bool isHexDigit(const char c) {
return isDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}
bool inRFC3986UnreservedChars(const char c) {
static const char unreserved[] = {'-', '.', '_', '~'};
return isAlpha(c) || isDigit(c) ||
......
......@@ -158,11 +158,15 @@ std::string joinPath(InputIterator first, InputIterator last) {
return strjoin(elements.begin(), elements.end(), "/");
}
bool isAlpha(const char c);
inline bool isAlpha(const char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
bool isDigit(const char c);
inline bool isDigit(const char c) { return '0' <= c && c <= '9'; }
bool isHexDigit(const char c);
inline bool isHexDigit(const char c) {
return isDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}
bool inRFC3986UnreservedChars(const char c);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment