--- parser3/src/include/pa_string.h 2012/05/28 10:33:18 1.204 +++ 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.204 2012/05/28 10:33:18 moko 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" @@ -508,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); } @@ -609,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; }