eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 1 | /* |
darin@apple.com | 2b4eb8f | 2008-10-14 19:19:33 +0000 | [diff] [blame] | 2 | * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 3 | * |
| 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 |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | #include "FormDataList.h" |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 23 | |
kinuko@chromium.org | 39d5d0c | 2010-07-14 19:26:26 +0000 | [diff] [blame] | 24 | #include "LineEnding.h" |
| 25 | |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 26 | namespace WebCore { |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 27 | |
mjs | 4235891 | 2006-02-27 09:17:06 +0000 | [diff] [blame] | 28 | FormDataList::FormDataList(const TextEncoding& c) |
| 29 | : m_encoding(c) |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 30 | { |
| 31 | } |
| 32 | |
darin | b3547a3 | 2006-09-06 04:40:44 +0000 | [diff] [blame] | 33 | void FormDataList::appendString(const String& s) |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 34 | { |
kinuko@chromium.org | 39d5d0c | 2010-07-14 19:26:26 +0000 | [diff] [blame] | 35 | CString cstr = m_encoding.encode(s.characters(), s.length(), EntitiesForUnencodables); |
jianli@chromium.org | 42e36c7 | 2010-08-31 04:45:21 +0000 | [diff] [blame] | 36 | m_items.append(normalizeLineEndingsToCRLF(cstr)); |
kinuko@chromium.org | 6d95dee | 2010-06-07 20:55:00 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | void FormDataList::appendString(const CString& s) |
| 40 | { |
jianli@chromium.org | 42e36c7 | 2010-08-31 04:45:21 +0000 | [diff] [blame] | 41 | m_items.append(s); |
kinuko@chromium.org | 6d95dee | 2010-06-07 20:55:00 +0000 | [diff] [blame] | 42 | } |
| 43 | |
jianli@chromium.org | 42e36c7 | 2010-08-31 04:45:21 +0000 | [diff] [blame] | 44 | void FormDataList::appendBlob(PassRefPtr<Blob> blob) |
kinuko@chromium.org | 6d95dee | 2010-06-07 20:55:00 +0000 | [diff] [blame] | 45 | { |
jianli@chromium.org | 42e36c7 | 2010-08-31 04:45:21 +0000 | [diff] [blame] | 46 | m_items.append(blob); |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 47 | } |
| 48 | |
eseidel | e0bd217 | 2006-01-10 09:33:44 +0000 | [diff] [blame] | 49 | } // namespace |