1 /************************************************************************
\r
3 ** Copyright (C) 2010 Strahinja Markovic
\r
5 ** This file is part of FlightCrew.
\r
7 ** FlightCrew is free software: you can redistribute it and/or modify
\r
8 ** it under the terms of the GNU Lesser General Public License as published
\r
9 ** by the Free Software Foundation, either version 3 of the License, or
\r
10 ** (at your option) any later version.
\r
12 ** FlightCrew is distributed in the hope that it will be useful,
\r
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 ** GNU Lesser General Public License for more details.
\r
17 ** You should have received a copy of the GNU Lesser General Public License
\r
18 ** along with FlightCrew. If not, see <http://www.gnu.org/licenses/>.
\r
20 *************************************************************************/
\r
32 * A qualified name of a node/element/attribute in XML.
\r
39 * @param new_local_name The local name.
\r
40 * @param new_namespace_name The namespace of the local name.
\r
42 QName( const std::string &new_local_name, const std::string &new_namespace_name )
\r
43 : local_name( new_local_name ), namespace_name ( new_namespace_name ) {};
\r
46 * Implements the equality operator.
\r
47 * Two QNames are equal if they have the same local and namespace names.
\r
48 * The exceptions are names that equal "*", which match any name.
\r
50 inline bool operator== ( const QName& other ) const
\r
52 return ( local_name == other.local_name || local_name == "*" || other.local_name == "*" ) &&
\r
53 ( namespace_name == other.namespace_name || namespace_name == "*" || other.namespace_name == "*" );
\r
57 * Implements the inequality operator.
\r
58 * Merely calls the equality operator and returns its inverted result.
\r
60 inline bool operator!= ( const QName& other ) const
\r
62 return !operator==( other );
\r
66 * The local name of the node.
\r
68 std::string local_name;
\r
71 * The namespace name the local name is located in.
\r
73 std::string namespace_name;
\r