WsdlElement.cpp

Go to the documentation of this file.
00001 /* 
00002  * wsdlpull - A C++ parser for WSDL (Web services description
00003  * language) Copyright (C) 2005-2007 Vivek Krishna
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 #include "wsdlparser/WsdlElement.h"
00021 #include "wsdlparser/WsdlParser.h"
00022 
00023 namespace WsdlPull {
00024 void
00025 WsdlElement::print(std::ostream & out)
00026 {
00027   size_t i;
00028   out << extElems_.size() << XmlUtils::dbsp << XmlUtils::dbsp;
00029   for (i = 0; i < extElems_.size(); i++)
00030     out << extElems_[i] << XmlUtils::dbsp;
00031   out << std::endl;
00032   out << extAttributes_.size() << XmlUtils::dbsp << XmlUtils::dbsp;
00033   for (i = 0; i < extAttributes_.size(); i++)
00034     out << extAttributes_[i] << XmlUtils::dbsp;
00035 }
00036 
00037 
00038 bool
00039 WsdlElement::getExtensibilityElements(const std::string & namespc,
00040                                       std::vector<int>& ids)
00041 {
00042   WsdlExtension * we = wParser_.getExtensibilityHandler(namespc);
00043   if (we == 0)
00044     return false;
00045   bool ret = false;
00046   for (size_t i = 0 ;i<extElems_.size();i++){
00047 
00048     if (we->getElementName(extElems_[i])!=0){
00049       ids.push_back(extElems_[i]);
00050       ret = true;
00051     }
00052   }
00053   return ret;
00054 }
00055 
00056   
00057 bool
00058 WsdlElement::getExtensibilityAttributes(const std::string & namespc,
00059                                         std::vector<int>& ids)
00060 {
00061   WsdlExtension * we = wParser_.getExtensibilityHandler(namespc);
00062   if (we == 0)
00063     return false;
00064   bool ret = false;
00065   for (size_t i = 0 ;i<extAttributes_.size();i++){
00066 
00067     if (we->getAttributeName(extAttributes_[i])!=0){
00068       ids.push_back(extAttributes_[i]);
00069       ret = true;
00070     }
00071   }
00072   return ret;
00073 }
00074 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2