wsdlpull 1.23
Loading...
Searching...
No Matches
Constraint.h
Go to the documentation of this file.
1/*
2 * wsdlpull - A C++ parser for WSDL (Web services description language)
3 * Copyright (C) 2005-2007 Vivek Krishna
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 */
20
21#ifndef CONSTRAINT_H
22#define CONSTRAINT_H
23// *********************************************************************
24// Include files:
25// *********************************************************************
26#include <string>
27#include <list>
29#include "schemaparser/Schema.h"
30#include "schemaparser/Annotation.h" // Proposed upgrade
31
32namespace Schema {
34{
35public:
37
38 std::string getName()const;
39 void setName(const std::string & n);
40 virtual Schema::ConstraintType getConstraintType();
41 void setSelector(const std::string & xpath);
42 void addField(const std::string &xpath);
43 std::string selector()const;
44 const std::list<std::string>& fields();
45 virtual ~Constraint();
46 void setAnnotation(const std::string & s);
47
48private:
49 Schema::ConstraintType m_constraints;
50 std::string m_name,m_annotation;
51 std::string m_selector;
52 std::list<std::string> m_fields;
53};
54
55inline
57 :m_constraints(c)
58{
59 m_fields.clear();
60}
61
62inline
63void
64Constraint::setSelector(const std::string & xpath)
65{
66 m_selector=xpath;
67}
68
69inline
70std::string
72{
73 return m_selector;
74}
75
76inline
77const std::list<std::string>&
79{
80 return m_fields;
81}
82
83inline
84void
85Constraint::addField(const std::string & xpath)
86{
87 m_fields.push_back(xpath);
88}
89
90inline
91std::string
93{
94 return m_name;
95}
96
97inline
98void
99Constraint::setName(const std::string &n)
100{
101 m_name=n;
102}
103
104inline
105void
106Constraint::setAnnotation(const std::string &s)
107{
108 m_annotation=s;
109}
110
111inline
113{
114}
115
116inline
119{
121}
122
123}
124#endif // GROUP_H
void addField(const std::string &xpath)
Definition Constraint.h:85
void setAnnotation(const std::string &s)
Definition Constraint.h:106
std::string getName() const
Definition Constraint.h:92
void setSelector(const std::string &xpath)
Definition Constraint.h:64
std::string selector() const
Definition Constraint.h:71
void setName(const std::string &n)
Definition Constraint.h:99
Constraint(Schema::ConstraintType c)
Definition Constraint.h:56
virtual ~Constraint()
Definition Constraint.h:112
const std::list< std::string > & fields()
Definition Constraint.h:78
virtual Schema::ConstraintType getConstraintType()
Definition Constraint.h:118
ConstraintType
Definition Schema.h:51
@ NoConstraint
Definition Schema.h:52
#define WSDLPULL_EXPORT