equal
deleted
inserted
replaced
|
1 #ifndef VMAILMGR__STR_LIST__H__ |
|
2 #define VMAILMGR__STR_LIST__H__ |
|
3 |
|
4 #include "mystring/mystring.h" |
|
5 |
|
6 class fdibuf; |
|
7 class fdobuf; |
|
8 |
|
9 class strlist |
|
10 { |
|
11 protected: |
|
12 mystring datastr; |
|
13 |
|
14 static const char* find(const mystring& str, const mystring& var, |
|
15 char suffix); |
|
16 public: |
|
17 strlist() { } |
|
18 strlist(const mystring& d) : datastr(d) { } |
|
19 |
|
20 mystring find(const mystring& prefix, char suffix = 0) const; |
|
21 void append(const mystring& str); |
|
22 |
|
23 mystring str() const { return datastr; } |
|
24 |
|
25 void operator=(const mystring& d) { datastr = d; } |
|
26 bool operator!() const { return !datastr; } |
|
27 |
|
28 bool read(const mystring&); |
|
29 bool read(fdibuf&); |
|
30 |
|
31 bool write(const mystring&) const; |
|
32 bool write(fdobuf&) const; |
|
33 }; |
|
34 |
|
35 class keystrlist : public strlist |
|
36 { |
|
37 public: |
|
38 keystrlist() { } |
|
39 keystrlist(const mystring& d) : strlist(d) { } |
|
40 |
|
41 mystring get(const mystring& var) const { return find(var, '='); } |
|
42 void set(const mystring& var, const mystring& val); |
|
43 |
|
44 void operator=(const mystring& d) { datastr = d; } |
|
45 }; |
|
46 |
|
47 #endif // VMAILMGR__STR_LIST__H__ |