00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _ComplexType_H
00023 #define _ComplexType_H
00024
00025 #include <string>
00026 #include <list>
00027 #include <map>
00028 #include "TypeBase.h"
00029
00030
00031 namespace Xml { class XmlNode; }
00032 class Wsdl;
00033
00034 class ComplexType : public TypeBase
00035 {
00036 public:
00037 ComplexType(const Wsdl& wsdl, const Xml::XmlNode& node, const std::string& name = "", const std::string& ns_prefix = "");
00038 ~ComplexType();
00039
00040 const std::string& Name() const { return m_name; }
00041 const std::string Documentation() const;
00042
00043 int NumberOfMembers() const;
00044 bool GetRef(std::string& ref) const;
00045
00046 std::list<std::pair<std::string, Xml::XmlNode> > GetMembers() const;
00047 std::list<std::pair<std::string, Xml::XmlNode> > GetAttributes() const;
00048
00049 void CreateInterface(FILE *fil, int lvl = 1) const;
00050 void CreateImplementation(FILE *fil) const;
00051
00052 const std::string CName() const;
00053
00054 bool OkToGenerate() const;
00055 void SetGenerated(bool x = true);
00056 bool IsGenerated() const;
00057
00058 bool IsSequence() const { return m_b_is_sequence; }
00059 bool IsAll() const { return m_b_is_all; }
00060 bool IsComplexContent() const { return m_b_complexContent; }
00061 bool IsArray() const { return m_b_is_array; }
00062 bool IsMixed() const { return m_b_is_mixed; }
00063
00064 static void ShowGenerated();
00065
00066 private:
00067 void reset_members(std::list<std::pair<std::string, Xml::XmlNode> >& members, std::list<std::pair<std::string, Xml::XmlNode> >& attrs, FILE *fil) const;
00068 void from_xml(std::list<std::pair<std::string, Xml::XmlNode> >& members, std::list<std::pair<std::string, Xml::XmlNode> >& attrs, FILE *fil) const;
00069 void to_string(std::list<std::pair<std::string, Xml::XmlNode> >& members, std::list<std::pair<std::string, Xml::XmlNode> >& attrs, FILE *fil) const;
00070 Xml::XmlNode Start() const;
00071
00072 std::string m_name;
00073 bool m_b_is_sequence;
00074 bool m_b_is_all;
00075 bool m_b_complexContent;
00076 bool m_b_is_array;
00077 bool m_b_is_mixed;
00078 std::string m_extends;
00079 std::string m_extends_cls;
00080 static std::map<std::string, bool> m_b_generated;
00081 };
00082
00083
00084
00085
00086 #endif // _ComplexType_H