--- parser3/src/include/pa_string.h 2012/05/24 12:49:25 1.203 +++ parser3/src/include/pa_string.h 2013/07/16 15:21:06 1.206 @@ -8,7 +8,7 @@ #ifndef PA_STRING_H #define PA_STRING_H -#define IDENT_PA_STRING_H "$Id: pa_string.h,v 1.203 2012/05/24 12:49:25 misha Exp $" +#define IDENT_PA_STRING_H "$Id: pa_string.h,v 1.206 2013/07/16 15:21:06 moko Exp $" // includes #include "pa_types.h" @@ -54,6 +54,7 @@ class VRegex; int pa_atoi(const char* str, const String* problem_source=0); double pa_atod(const char* str, const String* problem_source=0); +unsigned int pa_atoui(const char *str, int base, const String* problem_source=0); /// this is result of pos functions which mean that substr were not found #define STRING_NOT_FOUND ((size_t)-1) @@ -507,7 +508,7 @@ public: } } - String(int value, char *format); + String(int value, const char *format); String(Body abody, Language alang): body(abody), langs(alang) { ASSERT_STRING_INVARIANT(*this); } @@ -608,11 +609,14 @@ public: return *this; } - /// extracts first char of a string, if any char first_char() const { return is_empty()?0:body.fetch(0); } + char last_char() const { + return is_empty()?0:body.fetch(body.length()-1); + } + bool operator < (const String& src) const { return body (const String& src) const { return body>src.body; } bool operator <= (const String& src) const { return body<=src.body; }