Last change
on this file since 16180 was 15197, checked in by mdewsnip, 16 years ago |
Added an erase() function because we need to clean up the params list, for validation with the OAI validator. By DL Consulting Ltd.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
904 bytes
|
Rev | Line | |
---|
[8182] | 1 | #include <map>
|
---|
| 2 |
|
---|
| 3 | #include "text_t.h"
|
---|
| 4 |
|
---|
| 5 | class oaiargs
|
---|
| 6 | {
|
---|
| 7 | private:
|
---|
| 8 | text_tmap arguments;
|
---|
| 9 | text_t dummy;
|
---|
| 10 | bool duplicateArg;
|
---|
| 11 | // fill the input buffer to parse the arguments
|
---|
| 12 | void fillBuffer(istream &stream, unsigned char *buffer, unsigned char **currentPtr, unsigned char *end);
|
---|
| 13 | public:
|
---|
| 14 | oaiargs() { this->duplicateArg = false; }
|
---|
| 15 |
|
---|
| 16 | const text_t &operator [](const text_t &label) {
|
---|
| 17 | if (this->arguments.count(label) > 0) {
|
---|
| 18 | return this->arguments[label];
|
---|
| 19 | }
|
---|
| 20 | return dummy; // Dodgy, but text_t's are initialised to "", so should be fine
|
---|
| 21 | };
|
---|
[15197] | 22 |
|
---|
| 23 | void erase(const text_t &label) {
|
---|
| 24 | this->arguments.erase(label);
|
---|
| 25 | }
|
---|
| 26 |
|
---|
[8182] | 27 | void readArgs(istream &stream);
|
---|
| 28 | bool hasDuplicateArg() { return this->duplicateArg; }
|
---|
| 29 | int getSize(){return arguments.size();}
|
---|
| 30 | text_tmap::const_iterator begin(){return arguments.begin();};
|
---|
| 31 | text_tmap::const_iterator end(){return arguments.end();};
|
---|
| 32 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.