RequestData Class Reference
#include <RequestData.h>
List of all members.
|
Public Member Functions |
| | RequestData () |
| | ~RequestData () |
| int | getCount () const |
| std::string | get (const std::string key) |
| void | push (const std::string key, const std::string value) |
| void | set (const std::string key, const std::string value) |
| std::vector< std::string > | getAll (const std::string key) |
| void | dump () |
Constructor & Destructor Documentation
| RequestData::RequestData |
( |
|
) |
|
| RequestData::~RequestData |
( |
|
) |
|
00025 {
00026 for (unsigned int i = 0; i < storage.size(); i++){
00027 storage[i].clear();
00028 }
00029 storage.clear();
00030 tempVector.clear();
00031 }
Member Function Documentation
| void RequestData::dump |
( |
|
) |
|
00044 {
00045 for (unsigned int i = 0; i < storage.size(); i++){
00046 for (storageIter = storage[i].begin(); storageIter != storage[i].end(); ++storageIter){
00047 std::cerr << storageIter->first + " => " + storageIter->second + "\n";
00048 }
00049 }
00050 }
| std::string RequestData::get |
( |
const std::string |
key |
) |
|
00075 {
00076
00077 for (unsigned int i = 0; i < storage.size(); i++){
00078 storageIter = storage[i].find(key);
00079 if (storageIter != storage[i].end()){
00080 return storageIter->second;
00081 }
00082 }
00083 return "";
00084 }
| std::vector< std::string > RequestData::getAll |
( |
const std::string |
key |
) |
|
00086 {
00087
00088 tempVector.clear();
00089 for (unsigned int i = 0; i < storage.size(); i++){
00090 storageIter = storage[i].find(key);
00091 if (storageIter != storage[i].end()){
00092 tempVector.push_back(storageIter->second);
00093 }
00094 }
00095 return tempVector;
00096 }
| int RequestData::getCount |
( |
|
) |
const |
00040 {
00041 return paramsCount;
00042 }
| void RequestData::push |
( |
const std::string |
key, |
|
|
const std::string |
value | |
|
) |
| | |
00033 {
00034 data[key] = value;
00035 storage.push_back(data);
00036 ++paramsCount;
00037 data.clear();
00038 }
| void RequestData::set |
( |
const std::string |
key, |
|
|
const std::string |
value | |
|
) |
| | |
00052 {
00053 found = false;
00054
00055 for (unsigned int i = 0; i < storage.size(); i++){
00056 storageIter = storage[i].find(key);
00057 if (storageIter != storage[i].end()){
00058 if (found){
00059
00060 storage[i].clear();
00061 --paramsCount;
00062 continue;
00063 }
00064 found = true;
00065 storageIter->second = value;
00066 }
00067 }
00068 if (found){
00069 return;
00070 }
00071 push(key, value);
00072 ++paramsCount;
00073 }
The documentation for this class was generated from the following files: