#include <SimpleType.h>
Public Member Functions | |
SimpleType (const Wsdl &wsdl, const Xml::XmlNode &node, const std::string &name="", const std::string &ns_prefix="") | |
~SimpleType () | |
const std::string & | Name () const |
const std::string | Documentation () const |
void | CreateInterface (FILE *fil, int lvl=1) const |
const std::string | CType () const |
Private Attributes | |
std::string | m_name |
std::list< std::pair < std::string, std::string > > | m_enum |
Definition at line 32 of file SimpleType.h.
SimpleType::SimpleType | ( | const Wsdl & | wsdl, | |
const Xml::XmlNode & | node, | |||
const std::string & | name = "" , |
|||
const std::string & | ns_prefix = "" | |||
) |
Definition at line 30 of file SimpleType.cpp.
References TypeBase::Documentation(), m_enum, and TypeBase::SetType().
00031 : TypeBase(wsdl, node, ns_prefix, Split(name).Type) 00032 , m_name(!name.empty() ? name : node.PropertyExists("name") ? node.GetProperty("name") : "") 00033 { 00034 Xml::XmlNode n(node, "restriction"); 00035 if (n) 00036 { 00037 if (n.PropertyExists("base")) 00038 { 00039 std::string type = n.GetProperty("base"); 00040 SetType(type); 00041 } 00042 Xml::XmlNode n2(n, "enumeration"); 00043 while (n2) 00044 { 00045 std::string value = n2.GetProperty("value"); 00046 std::string doc = TypeBase::Documentation(n2); 00047 m_enum.push_back(std::pair<std::string, std::string>(value, doc)); 00048 ++n2; 00049 } 00050 } 00051 }
SimpleType::~SimpleType | ( | ) |
const std::string& SimpleType::Name | ( | ) | const [inline] |
const std::string SimpleType::Documentation | ( | ) | const |
Definition at line 59 of file SimpleType.cpp.
References TypeBase::Documentation(), and TypeBase::m_node.
00060 { 00061 return TypeBase::Documentation(m_node); 00062 }
void SimpleType::CreateInterface | ( | FILE * | fil, | |
int | lvl = 1 | |||
) | const |
Definition at line 65 of file SimpleType.cpp.
References CType(), and m_name.
Referenced by Wsdl::CreateInterface(), and ComplexType::CreateInterface().
00066 { 00067 for (int i = 0; i < lvl; i++) 00068 fprintf(fil, "\t"); 00069 fprintf(fil, "typedef %s %s;\n\n", CType().c_str(), Split(m_name).CName.c_str()); 00070 }
const std::string SimpleType::CType | ( | ) | const |
Reimplemented from TypeBase.
Definition at line 73 of file SimpleType.cpp.
References TypeBase::CType().
Referenced by Attribute::Attribute(), CreateInterface(), Element::CType_decl(), Attribute::CType_decl(), Element::CType_in(), Attribute::CType_in(), Element::CType_out(), Attribute::CType_out(), and Element::Element().
00074 { 00075 return TypeBase::CType(); 00076 }
std::string SimpleType::m_name [private] |
std::list<std::pair<std::string, std::string> > SimpleType::m_enum [private] |