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