From: Gonzalo A. <ga...@us...> - 2006-10-24 15:27:09
|
Update of /cvsroot/mod-c/ehtml/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26726/include Modified Files: Common.h Request.h Log Message: * Added support for multivalued inputs. This is quite common in HTML Forms with <select multiple="multiple" ... . Index: Request.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Request.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Request.h 18 Oct 2006 12:51:10 -0000 1.9 --- Request.h 24 Oct 2006 15:27:03 -0000 1.10 *************** *** 101,105 **** * @return the map of arguments. */ ! const KeyValueMap& GetArguments() { return Arguments; } /** --- 101,105 ---- * @return the map of arguments. */ ! const multiKeyValueMap& GetArguments() { return Arguments; } /** *************** *** 137,142 **** * client. */ ! KeyValueMap Arguments; ! /** * List of strings returned by <code>GetCookie(std::string& s) const</code>. --- 137,142 ---- * client. */ ! multiKeyValueMap Arguments; ! /** * List of strings returned by <code>GetCookie(std::string& s) const</code>. Index: Common.h =================================================================== RCS file: /cvsroot/mod-c/ehtml/include/Common.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Common.h 12 Oct 2006 21:10:35 -0000 1.11 --- Common.h 24 Oct 2006 15:27:03 -0000 1.12 *************** *** 136,139 **** --- 136,152 ---- /** + * Used for multivalued arguments + */ + class multiKeyValueMap: public std::multimap<std::string,std::string> { + typedef std::map<std::string,std::string> m; + typedef std::multimap<std::string,std::string> mm; + public: + multiKeyValueMap(); + virtual ~multiKeyValueMap(); + + std::string& operator[](const std::string&k); + }; + + /** * Parses a application/x-www-form-urlencoded string and puts key-values into * the given map. *************** *** 147,151 **** * @return non-zero if an error occured (it always returns 0 - it's fail safe). */ ! extern int ParseURLEncodedArgs( const char * Str, KeyValueMap& Map ); /** --- 160,164 ---- * @return non-zero if an error occured (it always returns 0 - it's fail safe). */ ! extern int ParseURLEncodedArgs( const char * Str, multiKeyValueMap& Map ); /** |