1/*
2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22#pragma once
23
24#include <wtf/Forward.h>
25#include <wtf/RefCounted.h>
26#include <wtf/text/WTFString.h>
27
28namespace WebCore {
29
30#if COMPILER(MSVC)
31#pragma warning(push)
32#pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" warning
33#endif
34
35class QuotesData : public RefCounted<QuotesData> {
36public:
37 static Ref<QuotesData> create(const Vector<std::pair<String, String>>& quotes);
38 ~QuotesData();
39
40 friend bool operator==(const QuotesData&, const QuotesData&);
41
42 const String& openQuote(unsigned index) const;
43 const String& closeQuote(unsigned index) const;
44
45private:
46 explicit QuotesData(const Vector<std::pair<String, String>>& quotes);
47
48 unsigned m_quoteCount;
49 std::pair<String, String> m_quotePairs[0];
50};
51
52#if COMPILER(MSVC)
53#pragma warning(pop)
54#endif
55
56inline bool operator!=(const QuotesData& a, const QuotesData& b)
57{
58 return !(a == b);
59}
60
61} // namespace WebCore
62