/* istring.h */ #ifndef ISTRING_H #define ISTRING_H #include class Istring; int numeric(string &s); inline int int_val(const string &s) {return atoi(s.c_str()); } inline static string itostr(int i) { char s[20]; itoa(i,s,10); return string(s); } class Istring : public string { public: Istring() : string() {}; Istring(string &s) : string(s) {}; Istring(const char *s) : string(s) {}; Istring(TSubString &ss) : string(ss) {}; Istring(int i) : string() { *this = itostr(i); } Istring(char c) : string(c) {}; operator int() { return int_val(*this); } operator char() { return *(this->c_str()); } Istring &operator=(int i) { *this = itostr(i); return *this; } Istring &operator=(char c) { *this = string(c); return *this; } }; string operator+(const Istring &s1,const Istring &s2); string operator+(char c, const Istring &s); string operator+(const Istring &s, char c); string operator+(const Istring &s, int i); string operator+(int i, const Istring &s); string operator+(const char *s1, const Istring &s2); string operator+(const Istring &s1,const char *s2); #endif