All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QName.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib 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
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file QName.cpp
22 
23  \brief A class to deal with XML qualified names.
24 */
25 
26 // TerraLib
27 #include "QName.h"
28 
30 {
31 }
32 
33 te::xsd::QName::QName(const std::string& prefix, const std::string& localPart)
34  : m_prefix(prefix),
35  m_localPart(localPart)
36 {
37 }
38 
40  : m_prefix(rhs.m_prefix),
41  m_localPart(rhs.m_localPart)
42 {
43 }
44 
46 {
47 }
48 
50 {
51  if(this != &rhs)
52  {
53  m_prefix = rhs.m_prefix;
54  m_localPart = rhs.m_localPart;
55  }
56 
57  return *this;
58 }
59 
61 {
62  return m_prefix + ":" + m_localPart;
63 }
64 
65 const std::string& te::xsd::QName::getPrefix() const
66 {
67  return m_prefix;
68 }
69 
70 const std::string& te::xsd::QName::getLocalPart() const
71 {
72  return m_localPart;
73 }
74 
75 void te::xsd::QName::setPrefix(const std::string& prefix)
76 {
77  m_prefix = prefix;
78 }
79 
80 void te::xsd::QName::setLocalPart(const std::string& localPart)
81 {
82  m_localPart = localPart;
83 }
QName()
Constructor.
Definition: QName.cpp:29
std::string m_prefix
The namespace prefix part of the qualified name. It must be associated with a namespace URI reference...
Definition: QName.h:120
~QName()
Destructor.
Definition: QName.cpp:45
A class to deal with XML qualified names.
void setPrefix(const std::string &prefix)
It sets the namespace prefix part of the qualified name.
Definition: QName.cpp:75
std::string m_localPart
The local part of the qualified name.
Definition: QName.h:121
void setLocalPart(const std::string &localPart)
It sets the local part of the qualified name.
Definition: QName.cpp:80
const std::string & getLocalPart() const
It returns the local part of the qualified name.
Definition: QName.cpp:70
std::string getQualifiedName() const
It returns the qualified name based on prefix and local part.
Definition: QName.cpp:60
QName & operator=(const QName &rhs)
Assignment operator.
Definition: QName.cpp:49
A class to be used to represent XML qualified names.
Definition: QName.h:49
const std::string & getPrefix() const
It returns the namespace prefix part of the qualified name.
Definition: QName.cpp:65