blob: 4503fd2f382e84961f2bc7aa1b793699682a2916 [file] [log] [blame]
eseidele0bd2172006-01-10 09:33:44 +00001/*
darin@apple.com2b4eb8f2008-10-14 19:19:33 +00002 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
eseidele0bd2172006-01-10 09:33:44 +00003 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
ddkilzerc8eccec2007-09-26 02:29:57 +000016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
eseidele0bd2172006-01-10 09:33:44 +000018 *
19 */
20
21#include "config.h"
22#include "FormDataList.h"
eseidele0bd2172006-01-10 09:33:44 +000023
kinuko@chromium.org39d5d0c2010-07-14 19:26:26 +000024#include "LineEnding.h"
25
darinb9481ed2006-03-20 02:57:59 +000026namespace WebCore {
eseidele0bd2172006-01-10 09:33:44 +000027
mjs42358912006-02-27 09:17:06 +000028FormDataList::FormDataList(const TextEncoding& c)
29 : m_encoding(c)
eseidele0bd2172006-01-10 09:33:44 +000030{
31}
32
darinb3547a32006-09-06 04:40:44 +000033void FormDataList::appendString(const String& s)
eseidele0bd2172006-01-10 09:33:44 +000034{
kinuko@chromium.org39d5d0c2010-07-14 19:26:26 +000035 CString cstr = m_encoding.encode(s.characters(), s.length(), EntitiesForUnencodables);
jianli@chromium.org42e36c72010-08-31 04:45:21 +000036 m_items.append(normalizeLineEndingsToCRLF(cstr));
kinuko@chromium.org6d95dee2010-06-07 20:55:00 +000037}
38
39void FormDataList::appendString(const CString& s)
40{
jianli@chromium.org42e36c72010-08-31 04:45:21 +000041 m_items.append(s);
kinuko@chromium.org6d95dee2010-06-07 20:55:00 +000042}
43
jianli@chromium.org42e36c72010-08-31 04:45:21 +000044void FormDataList::appendBlob(PassRefPtr<Blob> blob)
kinuko@chromium.org6d95dee2010-06-07 20:55:00 +000045{
jianli@chromium.org42e36c72010-08-31 04:45:21 +000046 m_items.append(blob);
eseidele0bd2172006-01-10 09:33:44 +000047}
48
eseidele0bd2172006-01-10 09:33:44 +000049} // namespace