1 /* 2 * Copyright 2006-2008 The FLWOR Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #pragma once 17 #ifndef ZORBA_TYPES_NODE_TEST_H 18 #define ZORBA_TYPES_NODE_TEST_H 19 20 #include <zorba/store_consts.h> 21 22 #include "zorbatypes/rchandle.h" 23 24 #include "store/api/item.h" 25 #include "zorbaserialization/class_serializer.h" 26 27 namespace zorba { 28 29 class TypeManager; 30 31 32 class NodeNameTest : virtual public SimpleRCObject 33 { 34 private: 35 zstring m_uri; 36 zstring m_local; 37 38 public: 39 SERIALIZABLE_CLASS(NodeNameTest) 40 SERIALIZABLE_CLASS_CONSTRUCTOR2(NodeNameTest, SimpleRCObject) 41 void serialize(::zorba::serialization::Archiver& ar); 42 43 public: 44 NodeNameTest(const zstring& uri, const zstring& local); 45 46 NodeNameTest(const store::Item_t& qname); 47 48 bool operator==(const NodeNameTest& other) const; 49 50 bool is_subname_of(const NodeNameTest& other) const; 51 52 bool matches(const store::Item* qname) const; 53 54 bool matches(const zstring& lname, const zstring& ns) const; 55 }; 56 57 58 } 59 60 #endif /* ZORBA_TEST_TYPES_H */ 61 62 /* 63 * Local variables: 64 * mode: c++ 65 * End: 66 */ 67 /* vim:set et sw=2 ts=2: */ 68