wsdlpull  1.23
WsdlElement.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 _WSDLELEMENTH
21 #define _WSDLELEMENTH
22 
23 #include <string>
24 #include <vector>
25 #include "xmlpull/Qname.h"
26 #include "xmlpull/XmlUtils.h"
27 #include "schemaparser/Element.h"
30 
31 using namespace Schema;
32 
33 //Implementation of a Wsdl element
34 //This is the base class of all wsdl elements
35 namespace WsdlPull{
36 class WsdlParser;
37 
39 {
40  public:
41 
43  virtual ~WsdlElement();
46 
51  std::string getName() const;
52 
57  const std::string getDocumentation() const;
58 
67  bool getExtensibilityElements(const std::string & namespc,
68  std::vector<int>& ids);
69 
70  bool getExtensibilityAttributes(const std::string & namespc,
71  std::vector<int>& ids);
72 
74 
77  void setName(std::string nam);
78  void addExtElement(int ident);
79  void addExtAttribute(int ident);
80  void setDocumentation(std::string* s);
82 
83  virtual void print(std::ostream & out);
84  protected:
85  std::string name_;
86  int id_;
87  std::vector<int> extElems_;
88  std::vector<int> extAttributes_;
89  std::string * doc_;
90  protected:
92 };
93 
94 inline
95 WsdlElement::WsdlElement(WsdlParser & w)
96  :wParser_(w)
97 {
98  doc_=0;
99  extElems_.clear();
100  extAttributes_.clear();
101 }
102 
103 inline
105 {
106 }
107 
108 inline
109 std::string
111 {
112  return name_;
113 }
114 
115 inline
116 const std::string
118 {
119  if (doc_)
120  return *doc_;
121  else
122  return std::string ();
123 }
124 
125 inline
126 void
127 WsdlElement::setName(std::string nam)
128 {
129  this->name_ = nam;
130 }
131 inline
132 void
134 {
135  doc_=s;
136 }
137 
138 inline
139 void
141 {
142  extElems_.push_back(id);
143 }
144 
145 inline
146 void
148 {
149  extAttributes_.push_back(id);
150 }
151 }
152 #endif /* */
std::string getName() const
Definition: WsdlElement.h:110
WsdlParser & wParser_
Definition: WsdlElement.h:91
std::vector< int > extAttributes_
Definition: WsdlElement.h:88
void addExtElement(int ident)
Definition: WsdlElement.h:140
void setDocumentation(std::string *s)
Definition: WsdlElement.h:133
std::string * doc_
Definition: WsdlElement.h:89
std::vector< int > extElems_
Definition: WsdlElement.h:87
#define WSDLPULL_EXPORT
void setName(std::string nam)
Definition: WsdlElement.h:127
void addExtAttribute(int ident)
Definition: WsdlElement.h:147
const std::string getDocumentation() const
Definition: WsdlElement.h:117