Merge branch 'develop' of ssh://barant.com/git/CoreUtils into develop
This commit is contained in:
commit
f35fa12902
27
CGIFormattedData.cpp
Normal file
27
CGIFormattedData.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include "CGIFormattedData.h"
|
||||||
|
#include "ZString.h"
|
||||||
|
|
||||||
|
namespace coreutils {
|
||||||
|
|
||||||
|
CGIFormattedData::CGIFormattedData() {}
|
||||||
|
|
||||||
|
CGIFormattedData::CGIFormattedData(ZString cgiData) {
|
||||||
|
cgiData.split("&");
|
||||||
|
for(int ix = 1; ix < cgiData.getList().size(); ++ix) {
|
||||||
|
cgiData[0].split("=");
|
||||||
|
data[cgiData[0]] = cgiData[1];
|
||||||
|
data[cgiData[0]].fromCGI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ZString CGIFormattedData::operator=(ZString cgiData) {
|
||||||
|
cgiData.split("&");
|
||||||
|
for(int ix = 1; ix < cgiData.getList().size(); ++ix) {
|
||||||
|
cgiData[0].split("=");
|
||||||
|
data[cgiData[0]] = cgiData[1];
|
||||||
|
data[cgiData[0]].fromCGI();
|
||||||
|
}
|
||||||
|
return cgiData;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
29
CGIFormattedData.h
Normal file
29
CGIFormattedData.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef __CGIFormattedData_h__
|
||||||
|
# define __CGIFormattedData_h__
|
||||||
|
|
||||||
|
# include "MString.h"
|
||||||
|
# include <map>
|
||||||
|
|
||||||
|
namespace coreutils {
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Use the CGIFormattedData object to store and process data that
|
||||||
|
/// interfaces to the CGI format. Value pairs are accessible using
|
||||||
|
/// a common map interface.
|
||||||
|
///
|
||||||
|
|
||||||
|
class CGIFormattedData {
|
||||||
|
|
||||||
|
public:
|
||||||
|
CGIFormattedData();
|
||||||
|
CGIFormattedData(ZString cgiData);
|
||||||
|
|
||||||
|
ZString operator=(ZString cgiData);
|
||||||
|
|
||||||
|
std::map<MString, MString> data;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user