Line | |
---|
1 | #include <string> |
---|
2 | #include "stopos_key.h" |
---|
3 | |
---|
4 | stopos_key::stopos_key() |
---|
5 | { |
---|
6 | this->value = this->firstchar; |
---|
7 | } |
---|
8 | |
---|
9 | stopos_key::stopos_key(const std::string & s) |
---|
10 | { |
---|
11 | this->value = s; |
---|
12 | } |
---|
13 | |
---|
14 | void stopos_key::increment(void) |
---|
15 | { // notused |
---|
16 | int p = this->value.size(); |
---|
17 | while(1) |
---|
18 | { |
---|
19 | p--; |
---|
20 | if (this->value[p] == lastchar) |
---|
21 | { |
---|
22 | this->value[p] = firstchar; |
---|
23 | if (p == 0) |
---|
24 | { |
---|
25 | this->value = firstchar + this->value; |
---|
26 | p = 1; |
---|
27 | } |
---|
28 | } |
---|
29 | else |
---|
30 | { |
---|
31 | this->value[p] ++; |
---|
32 | break; |
---|
33 | } |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | std::string stopos_key::str(void) const |
---|
38 | { |
---|
39 | return this->value; |
---|
40 | } |
---|
41 | |
---|
42 | bool stopos_key::operator==(const stopos_key &k) const |
---|
43 | { |
---|
44 | return k.value == this->value; |
---|
45 | } |
---|
46 | |
---|
47 | bool stopos_key::operator!=(const stopos_key &k) const |
---|
48 | { |
---|
49 | return k.value != this->value; |
---|
50 | } |
---|
51 | |
---|
Note: See
TracBrowser
for help on using the repository browser.