All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Documentation.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 Documentation.cpp
22 
23  \brief A class that models a documentation element used to enter text comments in annotations.
24 */
25 
26 // TerraLib
27 #include "Documentation.h"
28 
29 te::xsd::Documentation::Documentation(std::string* value, std::string* source, std::string* lang)
30  : m_value(value),
31  m_source(source),
32  m_lang(lang)
33 {
34 }
35 
37  : m_value(0),
38  m_source(0),
39  m_lang(0)
40 {
41  m_value = rhs.m_value ? new std::string(*rhs.m_value) : 0;
42  m_source = rhs.m_source ? new std::string(*rhs.m_source) : 0;
43  m_lang = rhs.m_lang ? new std::string(*rhs.m_lang) : 0;
44 }
45 
47 {
48  delete m_value;
49  delete m_source;
50  delete m_lang;
51 }
52 
54 {
55  if(this != &rhs)
56  {
57  delete m_value;
58 
59  m_value = rhs.m_value ? new std::string(*rhs.m_value) : 0;
60 
61  delete m_source;
62 
63  m_source = rhs.m_source ? new std::string(*rhs.m_source) : 0;
64 
65  delete m_lang;
66 
67  m_lang = rhs.m_lang ? new std::string(*rhs.m_lang) : 0;
68  }
69 
70  return *this;
71 }
72 
73 std::string* te::xsd::Documentation::getLang() const
74 {
75  return m_lang;
76 }
77 
79 {
80  return m_value;
81 }
82 
84 {
85  return m_source;
86 }
87 
88 void te::xsd::Documentation::setLang(std::string* lang)
89 {
90  delete m_lang;
91  m_lang = lang;
92 }
93 
94 void te::xsd::Documentation::setValue(std::string* doc)
95 {
96  delete m_value;
97  m_value = doc;
98 }
99 
100 void te::xsd::Documentation::setSource(std::string* source)
101 {
102  delete m_source;
103  m_source = source;
104 }
105 
107 {
108  return new Documentation(*this);
109 }
std::string * m_source
An URI reference that specifies the source of the information. (Optional)
Documentation(std::string *value, std::string *source=0, std::string *lang=0)
Constructor.
std::string * m_value
A human readable text. (Required)
void setSource(std::string *source)
It sets the URI reference that specifies the source of the information.
std::string * m_lang
The language of the information. Example: "en". (Optional)
Documentation & operator=(const Documentation &rhs)
Assignment operator.
std::string * getValue() const
It returns the information associated to the annotation.
void setLang(std::string *lang)
It sets the language of the information.
std::string * getSource() const
It returns the URI that specifies the source of the application information.
A class that models a documentation element used to enter text comments in annotations.
Definition: Documentation.h:48
void setValue(std::string *doc)
It sets the information associated to the annotation.
std::string * getLang() const
It returns the language used to code the annotation.
AnnotationItem * clone() const
It creates a clone of the annotation item.
A class that models a documentation element used to enter text comments in annotations.
A base class for XSD annotation elements.
~Documentation()
Destructor.