wsdlpull
1.23
Toggle main menu visibility
Loading...
Searching...
No Matches
src
wsdlparser
Message.cpp
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
#include "
xmlpull/XmlUtils.h
"
21
#include "
wsdlparser/Message.h
"
22
23
using namespace
std;
24
25
namespace
WsdlPull
{
26
int
27
Message::getPartIndex
(
string
& nam)
const
28
{
29
for
(
size_t
i = 0; i < parts.size(); i++)
30
{
31
if
(parts[i].name() == nam)
32
return
i;
33
}
34
return
-1;
35
}
36
37
Part::PartRefType
38
Message::getPartRefType
(
int
index)
const
39
{
40
return
parts[index].refType();
41
}
42
43
Part::PartRefType
44
Message::getPartRefType
(
const
string
& nam)
const
45
{
46
const
Part
* p=
getMessagePart
(nam);
47
if
(p)
48
return
p->
refType
();
49
else
50
return
Part::None
;
51
}
52
53
54
const
Part
*
55
Message::getMessagePart
(
const
std::string & nam)
const
56
{
57
for
(
size_t
i = 0; i < parts.size(); i++)
58
if
(parts[i].name() == nam)
59
return
&parts[i];
60
return
0;
61
}
62
63
int
64
Message::getPartType
(
const
std::string & nam)
const
65
{
66
const
Part
* p=
getMessagePart
(nam);
67
if
(p)
68
return
p->
type
();
69
else
70
return
0;
71
}
72
73
74
int
75
Message::getPartContentSchemaId
(
const
std::string & nam)
const
76
{
77
const
Part
* p=
getMessagePart
(nam);
78
if
(p)
79
return
p->
schemaId
();
80
else
81
return
0;
82
}
83
84
const
Part
*
85
Message::getMessagePart
(
size_t
index)
const
86
{
87
if
(index>=0 && index < parts.size())
88
return
&(parts[index]);
89
else
90
return
0;
91
}
92
93
void
94
Message::addPart
(
string
pname,
95
Part::PartRefType
reftype,
96
void
* d,
97
int
schema_id)
98
{
99
Part
p(pname);
100
if
(reftype==
Part::Elem
) {
101
p.
setPartElement
((
Element
*)d,schema_id);
102
}
else
{
103
p.
setPartType
(*((
int
*)d),schema_id);
104
}
105
parts.push_back(p);
106
}
107
108
void
109
Part::setPartType
(
int
typeId,
int
schema)
110
{
111
discriminator=
Part::Type
;
112
type_id
=typeId;
113
schema_id=schema;
114
}
115
116
void
117
Part::setPartElement
(
const
Element
* el,
int
schema)
118
{
119
discriminator=
Part::Elem
;
120
this->
e
=el;
121
schema_id=schema;
122
}
123
124
125
int
126
Part::type
()
const
127
{
128
if
(discriminator==
Part::Type
)
129
return
type_id
;
130
else
if
(
e
!=0)
131
return
e
->getType();
132
else
133
return
0;
134
}
135
136
const
Element
*
137
Part::element
()
const
138
{
139
if
(discriminator==
Part::Elem
)
140
return
e
;
141
else
142
return
0;
143
}
144
}
Message.h
XmlUtils.h
Schema::Element
Definition
Element.h:31
WsdlPull::Message::getPartContentSchemaId
int getPartContentSchemaId(int index) const
Definition
Message.h:167
WsdlPull::Message::getPartType
int getPartType(int index) const
Definition
Message.h:174
WsdlPull::Message::getPartRefType
Part::PartRefType getPartRefType(const std::string &nam) const
Definition
Message.cpp:44
WsdlPull::Message::getMessagePart
const Part * getMessagePart(size_t index) const
Definition
Message.cpp:85
WsdlPull::Message::addPart
void addPart(std::string pname, Part::PartRefType reftype, void *d, int schema_id)
Definition
Message.cpp:94
WsdlPull::Message::getPartIndex
int getPartIndex(std::string &nam) const
Definition
Message.cpp:27
WsdlPull::Part
Definition
Message.h:33
WsdlPull::Part::type_id
int type_id
Definition
Message.h:56
WsdlPull::Part::setPartType
void setPartType(int typeId, int schema)
Definition
Message.cpp:109
WsdlPull::Part::element
const Element * element() const
Definition
Message.cpp:137
WsdlPull::Part::type
int type() const
Definition
Message.cpp:126
WsdlPull::Part::e
const Element * e
Definition
Message.h:57
WsdlPull::Part::schemaId
int schemaId() const
Definition
Message.h:212
WsdlPull::Part::refType
PartRefType refType() const
Definition
Message.h:199
WsdlPull::Part::setPartElement
void setPartElement(const Element *e, int schema)
Definition
Message.cpp:117
WsdlPull::Part::PartRefType
PartRefType
Definition
Message.h:37
WsdlPull::Part::Elem
@ Elem
Definition
Message.h:39
WsdlPull::Part::None
@ None
Definition
Message.h:38
WsdlPull::Part::Type
@ Type
Definition
Message.h:40
WsdlPull
Definition
Binding.h:27
Generated by
1.17.0