wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
src
schemaparser
XSDType.h
Go to the documentation of this file.
1
/*
2
* wsdl2cpp - 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
22
/*
23
* Abstract interface for all xsd types
24
*/
25
26
27
#ifndef _XSDTYPEH
28
#define _XSDTYPEH
29
30
#include <string>
31
#include "
xmlpull/Qname.h
"
32
#include "
xmlpull/wsdlpull_export.h
"
33
#include "
schemaparser/Schema.h
"
34
35
36
namespace
Schema
{
37
class
WSDLPULL_EXPORT
XSDType
38
{
39
public
:
40
43
46
XSDType
(
const
std::string & ns);
47
XSDType
();
48
virtual
~ XSDType(){};
50
51
56
std::string getName()
const
;
61
62
std::string getNamespace()
const
;
67
Qname
getQname()
const
;
72
Schema::ContentModelType
getContentModel()
const
;
73
78
int
getTypeId()
const
;
84
int
getBaseTypeId()
const
;
89
Schema::Derivation
getBaseDerivation()
const
;
95
bool
isAnonymous()
const
;
101
virtual
bool
isSimple
()
const
=0;
102
104
virtual
void
setName
(std::string);
105
virtual
void
setContentModel
(
Schema::ContentModelType
);
106
virtual
void
setTypeId
(
int
);
107
virtual
void
setAnonymous
(
bool
);
108
void
setBaseType
(
int
id
,
Schema::Derivation
type =
Schema::Restriction
);
109
void
setBaseTypeNamespace
(std::string ns);
111
#ifdef LOGGING
112
virtual
void
print (std::ostream & out) { };
113
#endif
114
private
:
115
std::string nsUri_;
116
std::string name_;
117
int
typeId_;
118
int
baseType_;
119
Schema::Derivation
baseDerivation_;
120
Schema::ContentModelType
contentModel_;
//simple,complex,mixed?
121
bool
anonymous_;
122
};
123
124
inline
125
XSDType::XSDType
(
const
std::string & ns)
126
:nsUri_(ns),
127
typeId_(0),
128
baseType_(
Schema
::
XSD_ANYTYPE
),
129
baseDerivation_(
Schema
::
Extension
),
130
contentModel_(
Schema
::
None
),
131
anonymous_(false)
132
{
133
}
134
135
inline
136
XSDType::XSDType
()
137
:nsUri_(
Schema
::
SchemaUri
),
138
typeId_(0),
139
baseType_(
Schema
::
XSD_ANYTYPE
),
140
baseDerivation_(
Schema
::
Extension
),
141
contentModel_(
Schema
::
None
),
142
anonymous_(false)
143
{
144
}
145
146
inline
147
std::string
148
XSDType::getName
()
const
149
{
150
return
name_;
151
}
152
153
inline
154
Qname
155
XSDType::getQname
()
const
156
{
157
Qname
qn(name_);
158
qn.
setNamespace
(nsUri_);
159
return
qn;
160
}
161
162
inline
163
Schema::ContentModelType
164
XSDType::getContentModel
()
const
165
{
166
return
contentModel_;
167
}
168
169
inline
170
int
171
XSDType::getTypeId
()
const
172
{
173
return
typeId_;
174
}
175
176
inline
177
bool
178
XSDType::isAnonymous
()
const
179
{
180
return
anonymous_;
181
}
182
183
inline
184
int
185
XSDType::getBaseTypeId
()
const
186
{
187
return
baseType_;
188
}
189
190
inline
191
Schema::Derivation
192
XSDType::getBaseDerivation
()
const
193
{
194
return
baseDerivation_;
195
}
196
197
inline
198
void
199
XSDType::setTypeId
(
int
id
)
200
{
201
typeId_ = id;
202
}
203
204
inline
205
void
206
XSDType:: setBaseType
(
int
id
,
207
Schema::Derivation
type)
208
{
209
baseType_=id;
210
baseDerivation_=type;
211
}
212
213
inline
214
void
215
XSDType::setAnonymous
(
bool
flag)
216
{
217
anonymous_ = flag;
218
}
219
220
inline
221
void
222
XSDType::setName
(std::string name)
223
{
224
name_ = name;
225
}
226
227
inline
228
void
229
XSDType::setContentModel
(
Schema::ContentModelType
model)
230
{
231
contentModel_ = model;
232
}
233
234
inline
235
std::string
236
XSDType::getNamespace
()
const
237
{
238
return
nsUri_;
239
}
240
}
241
#endif
/* */
Qname.h
Schema.h
Qname
Definition
Qname.h:31
Qname::setNamespace
void setNamespace(std::string uri)
Definition
Qname.h:97
Schema::XSDType::isAnonymous
bool isAnonymous() const
Definition
XSDType.h:178
Schema::XSDType::getNamespace
std::string getNamespace() const
Definition
XSDType.h:236
Schema::XSDType::XSDType
XSDType(const std::string &ns)
Definition
XSDType.h:125
Schema::XSDType::setBaseType
void setBaseType(int id, Schema::Derivation type=Schema::Restriction)
Definition
XSDType.h:206
Schema::XSDType::getBaseTypeId
int getBaseTypeId() const
Definition
XSDType.h:185
Schema::XSDType::setAnonymous
virtual void setAnonymous(bool)
Definition
XSDType.h:215
Schema::XSDType::getName
std::string getName() const
Definition
XSDType.h:148
Schema::XSDType::setTypeId
virtual void setTypeId(int)
Definition
XSDType.h:199
Schema::XSDType::getBaseDerivation
Schema::Derivation getBaseDerivation() const
Definition
XSDType.h:192
Schema::XSDType::isSimple
virtual bool isSimple() const =0
Schema::XSDType::setContentModel
virtual void setContentModel(Schema::ContentModelType)
Definition
XSDType.h:229
Schema::XSDType::XSDType
XSDType()
Definition
XSDType.h:136
Schema::XSDType::setBaseTypeNamespace
void setBaseTypeNamespace(std::string ns)
Schema::XSDType::getQname
Qname getQname() const
Definition
XSDType.h:155
Schema::XSDType::getTypeId
int getTypeId() const
Definition
XSDType.h:171
Schema::XSDType::getContentModel
Schema::ContentModelType getContentModel() const
Definition
XSDType.h:164
Schema::XSDType::setName
virtual void setName(std::string)
Definition
XSDType.h:222
Schema
Definition
Annotation.h:27
Schema::Derivation
Derivation
Definition
Schema.h:38
Schema::Extension
@ Extension
Definition
Schema.h:40
Schema::Restriction
@ Restriction
Definition
Schema.h:39
Schema::SchemaUri
const std::string SchemaUri
Definition
Schema.h:92
Schema::ContentModelType
ContentModelType
Definition
Schema.h:44
Schema::None
@ None
Definition
Schema.h:45
Schema::XSD_ANYTYPE
@ XSD_ANYTYPE
Definition
Schema.h:88
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.17.0