00001 00005 /* 00006 Copyright (C) 2008-2009 Anders Hedstrom 00007 00008 This program is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 as published by the Free Software Foundation; either version 2 00011 of the License, or (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 #ifndef _Element_H 00023 #define _Element_H 00024 00025 #include <string> 00026 #include <list> 00027 #include "TypeBase.h" 00028 00029 00030 class Wsdl; 00031 class Application; 00032 00033 class Element : public TypeBase 00034 { 00035 public: 00036 Element(const Wsdl& wsdl, const Xml::XmlNode& node, bool in_sequence, bool in_choice, const std::string& name = "", const std::string& ns_prefix = ""); 00037 ~Element(); 00038 00039 const std::string& Name() const { return m_name; } 00040 const std::string& BaseType() const { return m_base_type; } 00041 const std::string Documentation() const; 00042 00043 void CreateInterface(FILE *fil) const; 00044 00045 bool IsOptional() const { return m_minOccurs == 0; } 00046 bool IsVector() const { return m_maxOccurs > 1 || m_maxOccurs == -1; } 00047 00048 const std::string CName() const; 00049 const std::string CName1up() const; 00050 00051 const std::string CType_decl() const; 00052 const std::string CType_in() const; 00053 const std::string CType_out() const; 00054 const std::string DefaultValue() const; 00055 00056 bool IsComplexType() const; 00057 bool IsSimpleType() const; 00058 00059 private: 00060 Application& m_appl; 00061 std::string m_name; 00062 std::string m_base_type; 00063 int m_minOccurs; 00064 int m_maxOccurs; 00065 }; 00066 00067 00068 00069 00070 #endif // _Element_H