OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ValueData() : m_nodeSet(NodeSet::create()) { } | 51 ValueData() : m_nodeSet(NodeSet::create()) { } |
52 explicit ValueData(const NodeSet& nodeSet) : m_nodeSet(NodeSet::create(nodeS
et)) { } | 52 explicit ValueData(const NodeSet& nodeSet) : m_nodeSet(NodeSet::create(nodeS
et)) { } |
53 explicit ValueData(NodeSet* nodeSet) : m_nodeSet(nodeSet) { } | 53 explicit ValueData(NodeSet* nodeSet) : m_nodeSet(nodeSet) { } |
54 explicit ValueData(const String& string) : m_string(string), m_nodeSet(NodeS
et::create()) { } | 54 explicit ValueData(const String& string) : m_string(string), m_nodeSet(NodeS
et::create()) { } |
55 | 55 |
56 Member<NodeSet> m_nodeSet; | 56 Member<NodeSet> m_nodeSet; |
57 }; | 57 }; |
58 | 58 |
59 // Copying Value objects makes their data partially shared, so care has to be ta
ken when dealing with copies. | 59 // Copying Value objects makes their data partially shared, so care has to be ta
ken when dealing with copies. |
60 class Value { | 60 class Value { |
61 DISALLOW_ALLOCATION(); | 61 DISALLOW_NEW(); |
62 public: | 62 public: |
63 enum Type { NodeSetValue, BooleanValue, NumberValue, StringValue }; | 63 enum Type { NodeSetValue, BooleanValue, NumberValue, StringValue }; |
64 | 64 |
65 Value(unsigned value) : m_type(NumberValue), m_bool(false), m_number(value)
{ } | 65 Value(unsigned value) : m_type(NumberValue), m_bool(false), m_number(value)
{ } |
66 Value(unsigned long value) : m_type(NumberValue), m_bool(false), m_number(va
lue) { } | 66 Value(unsigned long value) : m_type(NumberValue), m_bool(false), m_number(va
lue) { } |
67 Value(double value) : m_type(NumberValue), m_bool(false), m_number(value) {
} | 67 Value(double value) : m_type(NumberValue), m_bool(false), m_number(value) {
} |
68 | 68 |
69 Value(const char* value) : m_type(StringValue), m_bool(false), m_number(0),
m_data(ValueData::create(value)) { } | 69 Value(const char* value) : m_type(StringValue), m_bool(false), m_number(0),
m_data(ValueData::create(value)) { } |
70 Value(const String& value) : m_type(StringValue), m_bool(false), m_number(0)
, m_data(ValueData::create(value)) { } | 70 Value(const String& value) : m_type(StringValue), m_bool(false), m_number(0)
, m_data(ValueData::create(value)) { } |
71 Value(const NodeSet& value) : m_type(NodeSetValue), m_bool(false), m_number(
0), m_data(ValueData::create(value)) { } | 71 Value(const NodeSet& value) : m_type(NodeSetValue), m_bool(false), m_number(
0), m_data(ValueData::create(value)) { } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 , m_bool(value) | 107 , m_bool(value) |
108 , m_number(0) | 108 , m_number(0) |
109 { | 109 { |
110 } | 110 } |
111 | 111 |
112 } // namespace XPath | 112 } // namespace XPath |
113 | 113 |
114 } // namespace blink | 114 } // namespace blink |
115 | 115 |
116 #endif // XPathValue_h | 116 #endif // XPathValue_h |
OLD | NEW |