AnyAttribute.h
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 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 General Public License for more details.
14 
15  You should have received a copy of the GNU 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 AnyAttribute.h
22 
23  \brief It models an XML anyAttribute element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_ANYATTRIBUTE_H
27 #define __TERRALIB_XSD_INTERNAL_ANYATTRIBUTE_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Enums.h"
32 #include "Identifiable.h"
33 
34 namespace te
35 {
36  namespace xsd
37  {
38 // Forward declarations
39  class Annotation;
40 
41  /*!
42  \class AnyAttribute
43 
44  \brief It models an XML anyAttribute element.
45 
46  The anyAttribute element can be used to extend the XML document
47  with attributes not specified by the schema.
48  */
50  {
51  public:
52 
53  /*!
54  \brief Constructor.
55 
56  \param ann An annotation.
57  \param id It specifies a unique ID for the element.
58 
59  \note The AnyAttribute object will take the ownership of the annotation and id.
60  */
61  AnyAttribute(Annotation* ann = 0, std::string* id = 0);
62 
63  /*!
64  \brief Copy constructor.
65 
66  \param rhs Right-hand-side object.
67  */
68  AnyAttribute(const AnyAttribute& rhs);
69 
70  /*! \brief Destructor. */
71  ~AnyAttribute();
72 
73  /*!
74  \brief Assignment operator.
75 
76  \param rhs Right-hand-side object.
77 
78  \return A reference to this object.
79  */
80  AnyAttribute& operator=(const AnyAttribute& rhs);
81 
82  /*!
83  \brief It returns the namespaces containing the elements that can be used.
84 
85  \return The namespaces containing the elements that can be used.
86  */
87  std::string* getNamespace() const;
88 
89  /*!
90  \brief It returns how the XML processor should handle validation against the elements specified by this any element.
91 
92  \return The mode how the XML processor should handle validation: STRICT | LAX | SKIP.
93  */
94  ProcessContents getProcessContent() const;
95 
96  /*!
97  \brief It sets the namespaces containing the elements that can be used.
98 
99  \param ns The namespaces that will be used.
100 
101  \note The Any object will take the ownership of the given pointer.
102  */
103  void setNamespace(std::string* ns);
104 
105  /*!
106  \brief It sets how the XML processor should handle validation against the elements specified by this any element.
107 
108  \param pc It specifies how the XML processor should handle validation: STRICT | LAX | SKIP.
109  */
110  void setProcessContents(ProcessContents pc);
111 
112  private:
113 
114  std::string* m_namespace; //!< It specifies the namespaces containing the attributes that can be used. (Optional)
115  ProcessContents m_pContents; //!< It specifies how the XML processor should handle validation against the elements specified by this any element. (Optional)
116  };
117 
118  } // end namespace xsd
119 } // end namespace te
120 
121 #endif // __TERRALIB_XSD_INTERNAL_ANYATTRIBUTE_H
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
ProcessContents m_pContents
It specifies how the XML processor should handle validation against the elements specified by this an...
Definition: AnyAttribute.h:115
A base class for XSD classes that may allow annotation.
It models an XML anyAttribute element.
Definition: AnyAttribute.h:49
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
ProcessContents
It enumerates the possible ways that the XML processor should handle validation against the elements ...
Definition: Enums.h:123
URI C++ Library.
std::string * m_namespace
It specifies the namespaces containing the attributes that can be used. (Optional) ...
Definition: AnyAttribute.h:114
A base class for XSD classes that must provide a unique ID property.
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:57
A class that models a XSD annotation element.
Definition: Annotation.h:55