ht's Scheme Interpreter  1.0
a simplified scheme interpreter implementation
strutility.hpp
Go to the documentation of this file.
1 #ifndef __SCHEME_UTILITY_STRUTILITY
2 #define __SCHEME_UTILITY_STRUTILITY
3 #include <string>
4 #include <cstddef>
5 inline bool notSpecialChar(const std::string& s, size_t pos) { return pos<2 || s[pos-1]!='#' || s[pos-2]!='\\'; }
6 inline bool isChar(const std::string& s, size_t pos, char c) { return s[pos]==c && notSpecialChar(s, pos); }
7 inline std::string char2Str(char c) { std::string s; s.push_back(c); return s; }
8 inline int char2int(char c) { return c-'0'; }
9 #endif
int char2int(char c)
Definition: strutility.hpp:8
bool notSpecialChar(const std::string &s, size_t pos)
Definition: strutility.hpp:5
bool isChar(const std::string &s, size_t pos, char c)
Definition: strutility.hpp:6
std::string char2Str(char c)
Definition: strutility.hpp:7