wsdlpull  1.23
WsdlElement.cpp
Go to the documentation of this file.
1 /*
2  * wsdlpull - A C++ parser for WSDL (Web services description
3  * language) 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 "wsdlparser/WsdlElement.h"
21 #include "wsdlparser/WsdlParser.h"
22 
23 namespace WsdlPull {
24 void
25 WsdlElement::print(std::ostream & out)
26 {
27  size_t i;
28  out << extElems_.size() << XmlUtils::dbsp << XmlUtils::dbsp;
29  for (i = 0; i < extElems_.size(); i++)
30  out << extElems_[i] << XmlUtils::dbsp;
31  out << std::endl;
32  out << extAttributes_.size() << XmlUtils::dbsp << XmlUtils::dbsp;
33  for (i = 0; i < extAttributes_.size(); i++)
34  out << extAttributes_[i] << XmlUtils::dbsp;
35 }
36 
37 
38 bool
39 WsdlElement::getExtensibilityElements(const std::string & namespc,
40  std::vector<int>& ids)
41 {
43  if (we == 0)
44  return false;
45  bool ret = false;
46  for (size_t i = 0 ;i<extElems_.size();i++){
47 
48  if (we->getElementName(extElems_[i])!=0){
49  ids.push_back(extElems_[i]);
50  ret = true;
51  }
52  }
53  return ret;
54 }
55 
56 
57 bool
58 WsdlElement::getExtensibilityAttributes(const std::string & namespc,
59  std::vector<int>& ids)
60 {
62  if (we == 0)
63  return false;
64  bool ret = false;
65  for (size_t i = 0 ;i<extAttributes_.size();i++){
66 
67  if (we->getAttributeName(extAttributes_[i])!=0){
68  ids.push_back(extAttributes_[i]);
69  ret = true;
70  }
71  }
72  return ret;
73 }
74 }
WsdlParser.h
WsdlElement.h
WsdlPull
Definition: Binding.h:27
WsdlPull::WsdlElement::wParser_
WsdlParser & wParser_
Definition: WsdlElement.h:91
WsdlPull::WsdlElement::extAttributes_
std::vector< int > extAttributes_
Definition: WsdlElement.h:88
WsdlPull::WsdlElement::getExtensibilityElements
bool getExtensibilityElements(const std::string &namespc, std::vector< int > &ids)
Definition: WsdlElement.cpp:39
XmlUtils::dbsp
std::ostream & dbsp(std::ostream &str)
Definition: XmlUtils.cpp:90
WsdlPull::WsdlExtension::getElementName
virtual int getElementName(int id) const =0
WsdlPull::WsdlElement::getExtensibilityAttributes
bool getExtensibilityAttributes(const std::string &namespc, std::vector< int > &ids)
Definition: WsdlElement.cpp:58
WsdlPull::WsdlElement::print
virtual void print(std::ostream &out)
Definition: WsdlElement.cpp:25
WsdlPull::WsdlElement::extElems_
std::vector< int > extElems_
Definition: WsdlElement.h:87
WsdlPull::WsdlExtension
Definition: WsdlExtension.h:41
WsdlPull::WsdlParser::getExtensibilityHandler
WsdlExtension * getExtensibilityHandler(const std::string &ns)
Definition: WsdlParser.cpp:1261
WsdlPull::WsdlExtension::getAttributeName
virtual int getAttributeName(int id) const =0