#ifndef FormDataBuilder_h
#define FormDataBuilder_h
#include "platform/network/FormData.h"
#include "wtf/Forward.h"
namespace WTF{
class TextEncoding;
}
namespace WebCore {
class PLATFORM_EXPORT FormDataBuilder {
WTF_MAKE_NONCOPYABLE(FormDataBuilder);
public:
static WTF::TextEncoding encodingFromAcceptCharset(const String& acceptCharset, const String& inputEncoding, const String& defaultCharset);
static Vector<char> generateUniqueBoundaryString();
static void beginMultiPartHeader(Vector<char>&, const CString& boundary, const CString& name);
static void addBoundaryToMultiPartHeader(Vector<char>&, const CString& boundary, bool isLastBoundary = false);
static void addFilenameToMultiPartHeader(Vector<char>&, const WTF::TextEncoding&, const String& filename);
static void addContentTypeToMultiPartHeader(Vector<char>&, const CString& mimeType);
static void finishMultiPartHeader(Vector<char>&);
static void addKeyValuePairAsFormData(Vector<char>&, const CString& key, const CString& value, FormData::EncodingType = FormData::FormURLEncoded);
static void encodeStringAsFormData(Vector<char>&, const CString&);
private:
FormDataBuilder() {}
};
}
#endif