Any.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 Any.h
22 
23  \brief It models the XML Schema any element.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_ANY_H
27 #define __TERRALIB_XSD_INTERNAL_ANY_H
28 
29 // TerraLib
30 #include "Annotated.h"
31 #include "Enums.h"
32 #include "Identifiable.h"
33 #include "Occurs.h"
34 
35 // STL
36 #include <string>
37 
38 namespace te
39 {
40  namespace xsd
41  {
42  /*!
43  \class Any
44 
45  \brief It models the XML Schema any element.
46 
47  The any element can be used to extend the XML document with elements not specified by the schema.
48  */
49  class TEXSDEXPORT Any : public Occurs, public Identifiable, public Annotated
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 Any object will take the ownership of the annotation and id.
60  */
61  Any(Annotation* ann = 0, std::string* id = 0);
62 
63  /*!
64  \brief Copy constructor.
65 
66  \param rhs Right-hand-side object.
67  */
68  Any(const Any& rhs);
69 
70  /*! \brief Destructor. */
71  ~Any();
72 
73  /*!
74  \brief Assignment operator.
75 
76  \param rhs Right-hand-side object.
77 
78  \return A reference to this object.
79  */
80  Any& operator=(const Any& 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 elements 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_ANY_H
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
A base class for XSD classes that have occurs attributes.
Definition: Occurs.h:43
A base class for XSD classes that may allow annotation.
It models the XML Schema any element.
Definition: Any.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.
A base class for XSD classes that have occurs attributes.
std::string * m_namespace
It specifies the namespaces containing the elements that can be used. (Optional)
Definition: Any.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
ProcessContents m_pContents
It specifies how the XML processor should handle validation against the elements specified by this an...
Definition: Any.h:115
A class that models a XSD annotation element.
Definition: Annotation.h:55