All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Facet.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 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 Facet.cpp
22 
23  \brief This class can be used to model a facet (a constraint in the range of values).
24 */
25 
26 // TerraLib
27 #include "Facet.h"
28 
29 std::string te::xsd::Facet::m_typeNames[] = {std::string("Enumeration"),
30  std::string("FractionDigits"),
31  std::string("Length"),
32  std::string("MaxExclusive"),
33  std::string("MaxInclusive"),
34  std::string("MaxLength"),
35  std::string("MinExclusive"),
36  std::string("MinInclusive"),
37  std::string("MinLength"),
38  std::string("Pattern"),
39  std::string("TotalDigits"),
40  std::string("WhiteSpace")};
41 
42 te::xsd::Facet::Facet(FacetType fType, const std::string& value)
43  : m_type(fType),
44  m_value(value)
45 {
46 }
47 
49 {
50 }
51 
53 {
54 }
55 
57 {
58  return *this;
59 }
60 
62 {
63  return m_type;
64 }
65 
66 const std::string& te::xsd::Facet::getName() const
67 {
68  return m_typeNames[m_type];
69 }
70 
71 const std::string& te::xsd::Facet::getValue()
72 {
73  return m_value;
74 }
const std::string & getValue()
It returns the facet value.
Definition: Facet.cpp:71
const std::string & getName() const
It returns the facet type name.
Definition: Facet.cpp:66
Facet(FacetType fType, const std::string &value)
Constructor.
Definition: Facet.cpp:42
static std::string m_typeNames[12]
The list of names for available facet types.
Definition: Facet.h:105
This class can be used to model a facet (a constraint in the range of values).
Facet & operator=(const Facet &rhs)
Assignment operator.
Definition: Facet.cpp:56
FacetType
It enumerates the available facet types.
Definition: Enums.h:91
This class can be used to model a facet (a constraint in the range of values).
Definition: Facet.h:45
FacetType getType() const
It returns the facet type code.
Definition: Facet.cpp:61
~Facet()
Destructor.
Definition: Facet.cpp:52