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 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void appendBlob(const String& key, Blob* blob, const String& filename = Stri
ng()) | 104 void appendBlob(const String& key, Blob* blob, const String& filename = Stri
ng()) |
105 { | 105 { |
106 appendItem(Item(encodeAndNormalize(key), blob, filename)); | 106 appendItem(Item(encodeAndNormalize(key), blob, filename)); |
107 } | 107 } |
108 | 108 |
109 void deleteEntry(const String& key); | 109 void deleteEntry(const String& key); |
110 Entry getEntry(const String& key) const; | 110 Entry getEntry(const String& key) const; |
111 Entry getEntry(size_t index) const; | 111 Entry getEntry(size_t index) const; |
112 HeapVector<Entry> getAll(const String& key) const; | 112 HeapVector<Entry> getAll(const String& key) const; |
113 bool hasEntry(const String& key) const; | 113 bool hasEntry(const String& key) const; |
114 void setBlob(const String& key, Blob*, const String& filename); | |
115 void setData(const String& key, const String& value); | |
116 size_t size() const { return m_items.size(); } | 114 size_t size() const { return m_items.size(); } |
117 | 115 |
118 const FormDataListItems& items() const { return m_items; } | 116 const FormDataListItems& items() const { return m_items; } |
119 const WTF::TextEncoding& encoding() const { return m_encoding; } | 117 const WTF::TextEncoding& encoding() const { return m_encoding; } |
120 | 118 |
121 PassRefPtr<FormData> createFormData(FormData::EncodingType = FormData::FormU
RLEncoded); | 119 PassRefPtr<FormData> createFormData(FormData::EncodingType = FormData::FormU
RLEncoded); |
122 PassRefPtr<FormData> createMultiPartFormData(); | 120 PassRefPtr<FormData> createMultiPartFormData(); |
123 | 121 |
124 DECLARE_VIRTUAL_TRACE(); | 122 DECLARE_VIRTUAL_TRACE(); |
125 | 123 |
126 protected: | 124 protected: |
127 explicit FormDataList(const WTF::TextEncoding&); | 125 explicit FormDataList(const WTF::TextEncoding&); |
| 126 CString encodeAndNormalize(const String& key) const; |
| 127 |
| 128 FormDataListItems m_items; |
128 | 129 |
129 private: | 130 private: |
130 void appendKeyValuePairItemsTo(FormData*, const WTF::TextEncoding&, bool isM
ultiPartForm, FormData::EncodingType = FormData::FormURLEncoded); | 131 void appendKeyValuePairItemsTo(FormData*, const WTF::TextEncoding&, bool isM
ultiPartForm, FormData::EncodingType = FormData::FormURLEncoded); |
131 | 132 |
132 void appendItem(const Item&); | 133 void appendItem(const Item&); |
133 void setEntry(const Item&); | |
134 Entry itemsToEntry(const Item&) const; | 134 Entry itemsToEntry(const Item&) const; |
135 CString encodeAndNormalize(const String& key) const; | |
136 | 135 |
137 WTF::TextEncoding m_encoding; | 136 WTF::TextEncoding m_encoding; |
138 FormDataListItems m_items; | |
139 }; | 137 }; |
140 | 138 |
141 } // namespace blink | 139 } // namespace blink |
142 | 140 |
143 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Entry); | 141 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Entry); |
144 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Item); | 142 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::FormDataList::Item); |
145 | 143 |
146 #endif // FormDataList_h | 144 #endif // FormDataList_h |
OLD | NEW |