Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

formdata.h File Reference

This file defines functions to retrieve name-value form data pairs from a C string (which is probably obtained using Dv::Cgi::cgidata):. More...

#include <iostream>
#include <dvutil/props.h>

Include dependency graph for formdata.h:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  Dv
namespace  Dv::Cgi

Functions

bool urlencoded_formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert url encoded form data to <key,value> pairs in Dv::Util::Props.
bool multipart_formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert multipart encoded form data to <key,value> pairs in Dv::Util::Props.
bool formdata (const std::string &data, Dv::Util::Props &props) throw ()
 Convert formdata using either urlencoded_formdata or multipart_formdata.


Detailed Description

This file defines functions to retrieve name-value form data pairs from a C string (which is probably obtained using Dv::Cgi::cgidata):.

Definition in file formdata.h.


Function Documentation

bool urlencoded_formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert url encoded form data to <key,value> pairs in Dv::Util::Props.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props

bool multipart_formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert multipart encoded form data to <key,value> pairs in Dv::Util::Props.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored. For a ``file'' field with name ``myfile'' in a form, props[myfile] will contain the contents of the file while props[myfile-name] will contain the filename, if any was transmitted.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props

bool formdata const std::string &  data,
Dv::Util::Props props
throw ()
 

Convert formdata using either urlencoded_formdata or multipart_formdata.

Parameters:
data raw data, typically the result of calling Cgi::cgidata().
props where key=value pairs will be stored.
Returns:
true unless something went wrong.
Warning:
several values for the same keys will be appended to the value associated with the key, separated by comma's.
See also:
Dv::Util::Props


dvcgi-0.5.12 [27 April, 2004]