Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

WsdlElement.h

Go to the documentation of this file.
00001 /* 
00002  * wsdlpull - A C++ parser  for WSDL  (Web services description language)
00003  * 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 #ifndef _WSDLELEMENTH
00021 #define  _WSDLELEMENTH
00022 
00023 #include <string>
00024 #include <vector>
00025 #include "xmlpull/Qname.h"
00026 #include "xmlpull/XmlUtils.h"
00027 #include "schemaparser/Element.h"
00028 #include "wsdlparser/WsdlException.h"
00029 using namespace Schema;
00030 
00031 #ifndef WSDLPULL_EXPORT
00032 #if (defined _MSC_VER) && (defined _MT)
00033 #define WSDLPULL_EXPORT __declspec (dllimport)
00034 #else
00035 #define WSDLPULL_EXPORT 
00036 #endif
00037 #endif
00038 
00039 //Implementation of a Wsdl element
00040 //This is the base class of all wsdl elements
00041 namespace WsdlPull{
00042 class WsdlParser;
00043 
00044 class WSDLPULL_EXPORT WsdlElement
00045 {
00046  public:
00047   
00048   WsdlElement(WsdlParser& w);
00049   virtual ~WsdlElement();
00052 
00057   std::string getName() const;
00058 
00063   const  std::string getDocumentation() const;
00064 
00073   bool getExtensibilityElements(const std::string & namespc,
00074                                 std::vector<int>& ids);
00075   
00076   bool getExtensibilityAttributes(const std::string & namespc,
00077                                   std::vector<int>& ids);
00078   
00080 
00083   void setName(std::string nam);
00084   void addExtElement(int ident);
00085   void addExtAttribute(int ident);
00086   void setDocumentation(std::string* s);
00088 
00089   virtual void print(std::ostream & out);
00090  protected:
00091   std::string name_;
00092   int id_;
00093   std::vector<int> extElems_;
00094   std::vector<int> extAttributes_;
00095   std::string * doc_;
00096  protected:
00097   WsdlParser & wParser_;
00098 };
00099 
00100 inline
00101 WsdlElement::WsdlElement(WsdlParser & w)
00102   :wParser_(w)
00103 {
00104   doc_=0;
00105   extElems_.clear();
00106   extAttributes_.clear();
00107 }
00108 
00109 inline
00110 WsdlElement::~WsdlElement()
00111 {
00112 };
00113 
00114 inline
00115 std::string
00116 WsdlElement::getName() const
00117 {
00118   return name_;
00119 }
00120 
00121 inline
00122 const  std::string 
00123 WsdlElement::getDocumentation() const
00124 {
00125   if (doc_)
00126     return *doc_;
00127   else
00128     return std::string ();
00129 }
00130 
00131 inline
00132 void 
00133 WsdlElement::setName(std::string nam)
00134 {
00135   this->name_ = nam;
00136 } 
00137 inline
00138 void
00139 WsdlElement::setDocumentation(std::string* s)
00140 {     
00141   doc_=s;
00142 }
00143 
00144 inline
00145 void 
00146 WsdlElement::addExtElement(int id)
00147 {
00148   extElems_.push_back(id);
00149 }
00150 
00151 inline
00152 void
00153 WsdlElement::addExtAttribute(int id)
00154 {
00155   extAttributes_.push_back(id);
00156 }
00157 }
00158 #endif                                            /*  */

Generated on Mon Feb 6 23:02:42 2006 for wsdlpull by  doxygen 1.3.9.1