#ifndef HTML_FormDataList_h
#define HTML_FormDataList_h
#include "PlatformString.h"
#include "TextEncoding.h"
#include "DeprecatedValueList.h"
namespace WebCore {
struct FormDataListItem {
FormDataListItem(const DeprecatedCString &data) : m_data(data) { }
FormDataListItem(const DeprecatedString &path) : m_path(path) { }
DeprecatedString m_path;
DeprecatedCString m_data;
};
class FormDataList {
public:
FormDataList(const TextEncoding&);
void appendData(const String &key, const String &value)
{ appendString(key.deprecatedString()); appendString(value.deprecatedString()); }
void appendData(const String &key, const DeprecatedString &value)
{ appendString(key.deprecatedString()); appendString(value); }
void appendData(const String &key, const DeprecatedCString &value)
{ appendString(key.deprecatedString()); appendString(value); }
void appendData(const String &key, int value)
{ appendString(key.deprecatedString()); appendString(DeprecatedString::number(value)); }
void appendFile(const String &key, const String &filename);
DeprecatedValueListConstIterator<FormDataListItem> begin() const
{ return m_list.begin(); }
DeprecatedValueListConstIterator<FormDataListItem> end() const
{ return m_list.end(); }
private:
void appendString(const DeprecatedCString &s);
void appendString(const DeprecatedString &s);
TextEncoding m_encoding;
DeprecatedValueList<FormDataListItem> m_list;
};
};
#endif