| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 Value(Node* value) : m_type(NodeSetValue), m_bool(false), m_number(0), m_dat
a(ValueData::create()) { m_data->nodeSet().append(value); } | 72 Value(Node* value) : m_type(NodeSetValue), m_bool(false), m_number(0), m_dat
a(ValueData::create()) { m_data->nodeSet().append(value); } |
| 73 DECLARE_TRACE(); | 73 DECLARE_TRACE(); |
| 74 | 74 |
| 75 // This is needed to safely implement constructing from bool - with normal | 75 // This is needed to safely implement constructing from bool - with normal |
| 76 // function overloading, any pointer type would match. | 76 // function overloading, any pointer type would match. |
| 77 template<typename T> Value(T); | 77 template<typename T> Value(T); |
| 78 | 78 |
| 79 static const struct AdoptTag { } adopt; | 79 static const struct AdoptTag { } adopt; |
| 80 Value(NodeSet* value, const AdoptTag&) : m_type(NodeSetValue), m_bool(false)
, m_number(0), m_data(ValueData::create(value)) { } | 80 Value(NodeSet* value, const AdoptTag&) : m_type(NodeSetValue), m_bool(false)
, m_number(0), m_data(ValueData::create(value)) { } |
| 81 | 81 |
| 82 Type type() const { return m_type; } | 82 Type getType() const { return m_type; } |
| 83 | 83 |
| 84 bool isNodeSet() const { return m_type == NodeSetValue; } | 84 bool isNodeSet() const { return m_type == NodeSetValue; } |
| 85 bool isBoolean() const { return m_type == BooleanValue; } | 85 bool isBoolean() const { return m_type == BooleanValue; } |
| 86 bool isNumber() const { return m_type == NumberValue; } | 86 bool isNumber() const { return m_type == NumberValue; } |
| 87 bool isString() const { return m_type == StringValue; } | 87 bool isString() const { return m_type == StringValue; } |
| 88 | 88 |
| 89 // If this is called during XPathExpression::evaluate(), EvaluationContext | 89 // If this is called during XPathExpression::evaluate(), EvaluationContext |
| 90 // should be passed. | 90 // should be passed. |
| 91 const NodeSet& toNodeSet(EvaluationContext*) const; | 91 const NodeSet& toNodeSet(EvaluationContext*) const; |
| 92 NodeSet& modifiableNodeSet(EvaluationContext&); | 92 NodeSet& modifiableNodeSet(EvaluationContext&); |
| (...skipping 14 matching lines...) Expand all 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 |