Rev | Line | |
---|
[5] | 1 | class token{ |
---|
| 2 | private: |
---|
| 3 | std::string value; |
---|
| 4 | long id; |
---|
| 5 | unsigned int committed; |
---|
| 6 | std::fstream *file; |
---|
| 7 | char status; |
---|
| 8 | unsigned int pmarkerlen; |
---|
| 9 | std::string pmarker; |
---|
| 10 | // following lenths in char: |
---|
| 11 | static const unsigned int pointerlen = 16; // length of pointer |
---|
| 12 | static const unsigned int statstart = 0; |
---|
| 13 | static const unsigned int statlen = 1; // length of status |
---|
| 14 | static const unsigned int comstart = statstart + statlen; |
---|
| 15 | static const unsigned int comlen = 4; // length of nr commits |
---|
| 16 | static const unsigned int linenrstart = comstart + comlen; |
---|
| 17 | static const unsigned int linenrlen = 10; // length of linenr |
---|
| 18 | static const unsigned int valuestart = linenrstart + linenrlen; |
---|
| 19 | unsigned int linenr; |
---|
| 20 | unsigned int lenlen; |
---|
| 21 | public: |
---|
| 22 | token(void); |
---|
| 23 | void setid(long id); |
---|
| 24 | long getid(void); |
---|
| 25 | void ready(void); |
---|
| 26 | bool getready(void); |
---|
| 27 | void clearstatus(void); |
---|
| 28 | char getstatus(void); |
---|
| 29 | void setlinenr(unsigned int l); |
---|
| 30 | unsigned int getlinenr(void); |
---|
| 31 | void setvalue(std::string v); |
---|
| 32 | std::string getvalue(void); |
---|
| 33 | void setcommitted(unsigned int c); |
---|
| 34 | unsigned int getcommitted(void); |
---|
| 35 | void inccommitted(void); |
---|
| 36 | std::string gettotal(void); |
---|
| 37 | int puttotal(std::string t); |
---|
| 38 | void setfile(std::fstream& file); |
---|
| 39 | int readnext(std::streampos pos, std::streampos& posused,std::streampos& posnext); |
---|
| 40 | int writetoken(std::streampos& p); |
---|
| 41 | int writelocpointer(std::streampos locpointer); |
---|
| 42 | std::streampos readlocpointer(void); |
---|
| 43 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.