wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
src
schemaparser
ComplexType.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
#ifndef _COMPLEXTYPEH
21
#define _COMPLEXTYPEH
22
23
#include <list>
24
#include "
xmlpull/wsdlpull_export.h
"
25
#include "
xmlpull/Qname.h
"
26
#include "
xmlpull/XmlUtils.h
"
27
#include "
schemaparser/XSDType.h
"
28
#include "
schemaparser/ContentModel.h
"
29
#include "
schemaparser/Attribute.h
"
30
#include "
schemaparser/SchemaParserException.h
"
31
32
namespace
Schema
{
33
34
class
WSDLPULL_EXPORT
ComplexType
:
public
XSDType
35
{
36
public
:
37
38
ComplexType
(
const
std::string& );
39
~ComplexType
();
40
41
/*
42
* Various getter methods
43
*/
44
45
//virtual function ,always return false for complex types
46
bool
isSimple
()
const
;
47
48
//returns the content type for complex types whose content model is SIMPLE
49
int
getContentType
()
const
;
50
51
//returns the number of attributes ,indices start from 0 to n-1
52
int
getNumAttributes
()
const
;
53
54
//gets the id of the attribute at the position "index"
55
int
getAttributeType
(
int
index);
56
57
//gets the NCName of the attribute
58
std::string
getAttributeName
(
int
index)
const
;
59
60
//returns the content model structure
61
ContentModel
*
getContents
()
const
;
62
63
//returns a pointer to the attribute
64
const
Attribute
*
getAttribute
(
const
std::string & name)
const
;
65
66
const
Attribute
*
getAttribute
(
int
index)
const
;
67
//returns the list of attributes
68
std::list < Attribute > &
pAttributeList
() ;
69
70
/*
71
* Various setter methods
72
*/
73
74
void
setSimpleContentType
(
int
id
);
75
76
void
setContents
(
ContentModel
* ct);
77
78
void
addAttribute
(
const
Attribute
&a,
79
bool
fwdRef=
false
);
80
//forward reference to attributeGroup
81
void
addAttributeGroupName
(
const
Qname
& qn);
82
83
void
matchAttributeRef
(
const
std::string & name,
Attribute
& a);
84
void
matchElementRef
(
const
std::string & name,
Element
& e);
85
bool
checkOccurrences
(
void
);
86
void
resetCounters
(
void
);
87
88
89
#ifdef LOGGING
90
void
print(std::ostream & out);
91
#endif
92
93
private
:
94
std::list < Attribute > attList_;
95
int
simpleContentTypeId_;
//for simple content
96
ContentModel
* cm_;
97
void
error(std::string msg)
const
;
98
bool
fwdElemRef_, fwdAttrRef_;
99
};
100
101
102
inline
103
int
104
ComplexType::getContentType
()
const
105
{
106
return
simpleContentTypeId_;
107
}
108
109
inline
110
bool
111
ComplexType::isSimple
()
const
112
{
113
return
false
;
114
}
115
116
inline
117
int
118
ComplexType::getNumAttributes
()
const
119
{
120
return
attList_.size();
121
}
122
123
inline
124
int
125
ComplexType::getAttributeType
(
int
index)
126
{
127
return
getAttribute
(index)->
getType
();
128
}
129
130
inline
131
std::string
132
ComplexType::getAttributeName
(
int
index)
const
133
{
134
return
getAttribute
(index)->
getName
();
135
}
136
137
inline
138
std::list < Attribute > &
139
ComplexType::pAttributeList
()
140
{
141
return
attList_;
142
}
143
144
145
inline
146
void
147
ComplexType::setSimpleContentType
(
int
id
)
148
{
149
simpleContentTypeId_ = id;
150
}
151
152
153
inline
154
ContentModel
*
155
ComplexType::getContents
()
const
156
{
157
return
cm_;
158
159
}
160
161
inline
162
void
163
ComplexType::setContents
(
ContentModel
* ct)
164
{
165
cm_=ct;
166
}
167
168
169
inline
170
ComplexType::~ComplexType
()
171
{
172
if
(cm_)
173
delete
cm_;
174
}
175
}
176
#endif
/* */
Attribute.h
ContentModel.h
Qname.h
SchemaParserException.h
XSDType.h
XmlUtils.h
Qname
Definition
Qname.h:31
Schema::Attribute
Definition
Attribute.h:28
Schema::Attribute::getType
int getType() const
Definition
Attribute.h:90
Schema::Attribute::getName
std::string getName() const
Definition
Attribute.h:83
Schema::ComplexType::matchAttributeRef
void matchAttributeRef(const std::string &name, Attribute &a)
Definition
ComplexType.cpp:69
Schema::ComplexType::~ComplexType
~ComplexType()
Definition
ComplexType.h:170
Schema::ComplexType::pAttributeList
std::list< Attribute > & pAttributeList()
Definition
ComplexType.h:139
Schema::ComplexType::ComplexType
ComplexType(const std::string &)
Definition
ComplexType.cpp:26
Schema::ComplexType::getAttributeType
int getAttributeType(int index)
Definition
ComplexType.h:125
Schema::ComplexType::getContents
ContentModel * getContents() const
Definition
ComplexType.h:155
Schema::ComplexType::resetCounters
void resetCounters(void)
Schema::ComplexType::setSimpleContentType
void setSimpleContentType(int id)
Definition
ComplexType.h:147
Schema::ComplexType::addAttributeGroupName
void addAttributeGroupName(const Qname &qn)
Definition
ComplexType.cpp:53
Schema::ComplexType::addAttribute
void addAttribute(const Attribute &a, bool fwdRef=false)
Definition
ComplexType.cpp:38
Schema::ComplexType::isSimple
bool isSimple() const
Definition
ComplexType.h:111
Schema::ComplexType::getNumAttributes
int getNumAttributes() const
Definition
ComplexType.h:118
Schema::ComplexType::checkOccurrences
bool checkOccurrences(void)
Schema::ComplexType::matchElementRef
void matchElementRef(const std::string &name, Element &e)
Definition
ComplexType.cpp:61
Schema::ComplexType::getAttributeName
std::string getAttributeName(int index) const
Definition
ComplexType.h:132
Schema::ComplexType::setContents
void setContents(ContentModel *ct)
Definition
ComplexType.h:163
Schema::ComplexType::getAttribute
const Attribute * getAttribute(const std::string &name) const
Definition
ComplexType.cpp:80
Schema::ComplexType::getContentType
int getContentType() const
Definition
ComplexType.h:104
Schema::ContentModel
Definition
ContentModel.h:37
Schema::Element
Definition
Element.h:31
Schema::XSDType::XSDType
XSDType(const std::string &ns)
Definition
XSDType.h:125
Schema
Definition
Annotation.h:27
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.17.0