19 void setError(
const char* msg, ...) __attribute__((format(printf, 2, 3)));
21 inline void resetError() {
25 inline std::string getBetween (
const std::string& str,
const std::string& tokenStart,
const std::string& tokenEnd) {
26 const std::size_t start = str.find(tokenStart);
27 if (start == std::string::npos) {
31 const std::size_t end = str.find(tokenEnd);
32 if (end == std::string::npos) {
33 setError(
"syntax error - expected %s", tokenEnd.c_str());
36 const size_t startIndex = start + 1;
37 const size_t endIndex = end - startIndex;
41 const std::string& between = str.substr(startIndex, endIndex);
46 const std::string& getError()
const;
49 inline void IParser::setError(
const char* msg, ...) {
53 std::vsnprintf(buf,
sizeof(buf), msg, args);
62 inline const std::string& IParser::getError()
const {
#define ai_log_debug(...)
Logging macro to provide your own loggers.
Definition: Types.h:37