OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 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 | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef FormDataList_h | 21 #ifndef FormDataList_h |
22 #define FormDataList_h | 22 #define FormDataList_h |
23 | 23 |
24 #include "core/CoreExport.h" | 24 #include "core/CoreExport.h" |
25 #include "core/fileapi/Blob.h" | 25 #include "core/fileapi/Blob.h" |
26 #include "core/fileapi/File.h" | 26 #include "core/fileapi/File.h" |
27 #include "platform/heap/Handle.h" | 27 #include "platform/heap/Handle.h" |
28 #include "platform/network/FormData.h" | 28 #include "platform/network/EncodedFormData.h" |
29 #include "wtf/Forward.h" | 29 #include "wtf/Forward.h" |
30 #include "wtf/text/CString.h" | 30 #include "wtf/text/CString.h" |
31 #include "wtf/text/TextEncoding.h" | 31 #include "wtf/text/TextEncoding.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 // TODO(tkent): Merge FormDataList into DOMFormData. | 35 // TODO(tkent): Merge FormDataList into DOMFormData. |
36 class CORE_EXPORT FormDataList : public GarbageCollected<FormDataList> { | 36 class CORE_EXPORT FormDataList : public GarbageCollected<FormDataList> { |
37 public: | 37 public: |
38 // TODO(tkent): Merge Entry and Item. | 38 // TODO(tkent): Merge Entry and Item. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void deleteEntry(const String& key); | 105 void deleteEntry(const String& key); |
106 Entry getEntry(const String& key) const; | 106 Entry getEntry(const String& key) const; |
107 Entry getEntry(size_t index) const; | 107 Entry getEntry(size_t index) const; |
108 HeapVector<Entry> getAll(const String& key) const; | 108 HeapVector<Entry> getAll(const String& key) const; |
109 bool hasEntry(const String& key) const; | 109 bool hasEntry(const String& key) const; |
110 size_t size() const { return m_items.size(); } | 110 size_t size() const { return m_items.size(); } |
111 | 111 |
112 const FormDataListItems& items() const { return m_items; } | 112 const FormDataListItems& items() const { return m_items; } |
113 const WTF::TextEncoding& encoding() const { return m_encoding; } | 113 const WTF::TextEncoding& encoding() const { return m_encoding; } |
114 | 114 |
115 PassRefPtr<FormData> createFormData(FormData::EncodingType = FormData::FormU
RLEncoded); | 115 PassRefPtr<EncodedFormData> createFormData(EncodedFormData::EncodingType = E
ncodedFormData::FormURLEncoded); |
116 PassRefPtr<FormData> createMultiPartFormData(); | 116 PassRefPtr<EncodedFormData> createMultiPartFormData(); |
117 | 117 |
118 DECLARE_VIRTUAL_TRACE(); | 118 DECLARE_VIRTUAL_TRACE(); |
119 | 119 |
120 protected: | 120 protected: |
121 explicit FormDataList(const WTF::TextEncoding&); | 121 explicit FormDataList(const WTF::TextEncoding&); |
122 CString encodeAndNormalize(const String& key) const; | 122 CString encodeAndNormalize(const String& key) const; |
123 | 123 |
124 FormDataListItems m_items; | 124 FormDataListItems m_items; |
125 | 125 |
126 private: | 126 private: |
127 void appendKeyValuePairItemsTo(FormData*, const WTF::TextEncoding&, bool isM
ultiPartForm, FormData::EncodingType = FormData::FormURLEncoded); | 127 void appendKeyValuePairItemsTo(EncodedFormData*, const WTF::TextEncoding&, b
ool isMultiPartForm, EncodedFormData::EncodingType = EncodedFormData::FormURLEnc
oded); |
128 | 128 |
129 void appendItem(const Item&); | 129 void appendItem(const Item&); |
130 Entry itemsToEntry(const Item&) const; | 130 Entry itemsToEntry(const Item&) const; |
131 | 131 |
132 WTF::TextEncoding m_encoding; | 132 WTF::TextEncoding m_encoding; |
133 }; | 133 }; |
134 | 134 |
135 } // namespace blink | 135 } // namespace blink |
136 | 136 |
137 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Entry); | 137 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Entry); |
138 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Item); | 138 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Item); |
139 | 139 |
140 #endif // FormDataList_h | 140 #endif // FormDataList_h |
OLD | NEW |