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

Attribute.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  */
00021 #ifndef _ATTRIBUTEH
00022 #define _ATTRIBUTEH
00023 #include <string>
00024 
00025 class Attribute
00026 {
00027  public:
00028   Attribute(const std::string & name, 
00029             int type_id,
00030             bool qualified = false,
00031             std::string defaultVal = "", 
00032             std::string fixedVal = "", 
00033             bool use = false);
00034   Attribute(void);
00035 
00036   std::string getName() const;
00037   int getType() const;
00038   bool isRequired() const;
00039   std::string  defaultVal()const;
00040   std::string  fixedVal()const;
00041   bool isQualified()const ;
00042   Attribute & operator = (const Attribute & a);
00043 
00044  private:
00045   std::string attName;
00046   std::string dval, fval;
00047   int attType;
00048   bool bQualified, attUse;
00049 
00050 };
00051 #ifdef LOGGING
00052 ostream & operator << (ostream & stream, Attribute & a);
00053 #endif                                            /*  */
00054 
00055 inline
00056 Attribute::Attribute(const std::string & name, 
00057                      int type_id,
00058                      bool qualified,
00059                      std::string defaultVal, 
00060                      std::string fixedVal, 
00061                      bool use)
00062   :attName(name),
00063      dval(defaultVal),
00064      fval(fixedVal),
00065      attType(type_id),
00066      bQualified (qualified),
00067      attUse (use)
00068 {
00069 }
00070 
00071 inline
00072 Attribute::Attribute(void)
00073   :attType(0),
00074      bQualified (false),
00075      attUse (false)
00076 {
00077 }
00078 
00079 inline
00080 std::string
00081 Attribute::getName() const
00082 {
00083   return attName;
00084 }
00085 
00086 inline
00087 int 
00088 Attribute::getType() const
00089 {
00090   return attType;
00091 }
00092 
00093 inline
00094 bool
00095 Attribute::isRequired() const
00096 {
00097   return attUse;
00098 }
00099 
00100 inline
00101 std::string 
00102 Attribute::defaultVal()const
00103 {
00104   return dval;
00105 }
00106 
00107 inline
00108 std::string 
00109 Attribute::fixedVal()const
00110 {
00111   return fval;
00112 }
00113 
00114 inline
00115 bool 
00116 Attribute::isQualified()const 
00117 {
00118   return bQualified;
00119 }
00120 
00121 inline
00122 Attribute & 
00123 Attribute::operator = (const Attribute & a)
00124 {
00125   attName = a.attName;
00126   attType = a.attType;
00127   bQualified = a.isQualified();
00128   dval = a.dval;
00129   fval = a.fval;
00130   attUse = a.attUse;
00131   return *this;
00132 }
00133 
00134 #endif                                            /*  */

Generated on Sun Oct 16 10:11:52 2005 for wsdlpull by  doxygen 1.3.9.1