Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct token
- {
- int id;
- string s;
- token(string st, int i);
- };
- struct _chsetrule
- {
- string _from;
- string _to;
- };
- class superstring
- {
- private:
- vector<token>tokens;
- bool rae;
- protected:
- bool lck;
- unsigned int lpos;
- public:
- unsigned int pos;/** Position */
- string str;/** Container string, DO NOT OVERUSE THIS, the type MAY CHANGE in future API versions */
- /** Core functions*/
- ~superstring();
- superstring();
- superstring& lock();
- superstring& lock(unsigned int lp);
- superstring& unlock();
- bool atbegin();
- bool atend();
- size_t length();
- size_t size();
- void clear();
- const char* c_str();
- superstring& go_begin();
- superstring& go_end();
- superstring& go_begin(int p);
- superstring& go_end(int p);
- superstring& go_pos(int p);
- char& operator[](unsigned int i);
- /** C++ string functions*/
- superstring(string s);
- void set(string s);
- void operator()(string s);
- superstring& operator+=(string in);
- string skip(string stb);
- string tochar(string fend);
- bool contain(string stb);
- bool contain_not(string stb);
- bool contain_only(string stb);
- string to(string fend);
- string back_to(string fend);
- string from(string start);
- unsigned int find(string str);
- int check(string sch);
- string get(unsigned int n);
- string get_begin(unsigned int n);
- string get_end(unsigned int n);
- superstring& change(string from, string to);
- superstring& remove(string from, string to);
- superstring& remove(string s);
- static int int_from_str(string in);
- /** SuperString functions*/
- void set(superstring s);
- void operator()(superstring s);
- superstring operator+=(superstring in);
- superstring skip(superstring stb);
- superstring tochar(superstring fend);
- bool contain(superstring stb);
- bool contain_not(superstring stb);
- bool contain_only(superstring stb);
- superstring to(superstring fend);
- superstring back_to(superstring fend);
- superstring from(superstring start);
- /** Integer functions*/
- void set(int s);
- void operator()(int s);
- superstring operator*=(unsigned int rc);
- static string str_from_int(int in);
- static superstring sst_from_int(int in);
- string from(unsigned int sp);
- string to(unsigned int ep);
- superstring& remove(unsigned int from, unsigned int to);
- /** 64bit integer functions */
- static string str_from_int64(int64_t in);
- static superstring sst_from_int64(int64_t in);
- static int64_t int64_from_sst(superstring in);
- static int64_t int64_from_str(string in);
- /** Size functions */
- static string str_from_size(int64_t in);
- static superstring sst_from_size(int64_t in);
- /** Double precission functions */
- static string str_from_double(double in);
- static superstring sst_from_double(double in);
- /** Token functions*/
- superstring& add_token(token t);
- void clear_tokens();
- token tok();
- token tok(string &opt);
- size_t num_tokens();
- /** Character functions*/
- int count(const char c);
- /** File functions*/
- static string file(string fn);
- void set_file(string fn);
- void append_file(string fn);
- static int file(string fn, string content);
- static int str_to_file(string fn, string content);
- static int sst_to_file(string fn, superstring content);
- static int append_str_file(string fn, string append);
- static int append_sst_file(string fn, superstring append);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement