diff options
Diffstat (limited to 'WebCore/html/FormDataList.h')
-rw-r--r-- | WebCore/html/FormDataList.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/WebCore/html/FormDataList.h b/WebCore/html/FormDataList.h index cdff8f7..aec1a52 100644 --- a/WebCore/html/FormDataList.h +++ b/WebCore/html/FormDataList.h @@ -1,11 +1,5 @@ /* - * This file is part of the DOM implementation for KDE. - * - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. - * (C) 2006 Alexey Proskuryakov (ap@nypop.com) + * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -28,21 +22,11 @@ #define FormDataList_h #include "CString.h" -#include "PlatformString.h" +#include "File.h" #include "TextEncoding.h" -#include <wtf/Vector.h> namespace WebCore { -struct FormDataListItem { - FormDataListItem() { } - FormDataListItem(const CString& data) : m_data(data) { } - FormDataListItem(const String& path) : m_path(path) { } - - String m_path; - CString m_data; -}; - class FormDataList { public: FormDataList(const TextEncoding&); @@ -53,16 +37,31 @@ public: { appendString(key); appendString(value); } void appendData(const String& key, int value) { appendString(key); appendString(String::number(value)); } - void appendFile(const String& key, const String& filename); + void appendFile(const String& key, PassRefPtr<File> file) + { appendString(key); m_list.append(file); } + + class Item { + public: + Item() { } + Item(const CString& data) : m_data(data) { } + Item(PassRefPtr<File> file) : m_file(file) { } + + const CString& data() const { return m_data; } + File* file() const { return m_file.get(); } + + private: + CString m_data; + RefPtr<File> m_file; + }; - const Vector<FormDataListItem>& list() const { return m_list; } + const Vector<Item>& list() const { return m_list; } private: void appendString(const CString&); void appendString(const String&); TextEncoding m_encoding; - Vector<FormDataListItem> m_list; + Vector<Item> m_list; }; } // namespace WebCore |