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