29#include <sptk5/wsdl/OpenApiGenerator.h>
30#include <sptk5/wsdl/WSOperation.h>
31#include <sptk5/wsdl/WSParserComplexType.h>
53 using ElementMap = std::map<String, const WSParserElement*>;
58 void addType(
const sptk::String& elementName,
const SWSParserComplexType& complexType)
60 m_complexTypes[elementName] = complexType;
63 void add(
const sptk::String& elementName,
const SWSParserComplexType& complexType)
65 m_complexTypes[elementName] = complexType;
66 m_elements[elementName] = complexType.get();
71 m_complexTypes.clear();
77 auto itor = m_elements.find(elementName);
78 if (itor == m_elements.end())
80 throw Exception(context +
": Element '" + elementName +
"' not found");
85 [[nodiscard]]
const ElementMap& elements()
const
90 [[nodiscard]] SWSParserComplexType complexType(
const sptk::String& elementName,
93 auto itor = m_complexTypes.find(elementName);
94 if (itor == m_complexTypes.end())
96 throw Exception(context +
": Complex type '" + elementName +
"' not found");
103 return m_complexTypes;
148 void parse(
const fs::path& wsdlFile);
157 const String& serviceNamespace =
"");
179 const String& description()
const;
227 String m_serviceNamespace;
SPTK generic exception class.
Definition: Exception.h:56
Definition: WSParserComplexType.h:118
Definition: WSParser.h:56
Definition: WSParser.h:48
std::map< String, const xdoc::Node * > XmlTypeMap
Definition: WSParser.h:114
static String strip_namespace(const String &name)
void parseComplexType(xdoc::SNode &complexTypeElement)
void parseOperation(const xdoc::SNode &operationNode)
void generateWsdlCxx(const String &sourceDirectory, const String &headerFile, const fs::path &wsdlFileName) const
std::map< String, String > DocumentationMap
Definition: WSParser.h:119
void generateDefinition(const Strings &usedClasses, std::ostream &output)
static void parseSimpleType(const xdoc::SNode &simpleTypeElement)
std::map< String, const WSParserElement * > ElementMap
Definition: WSParser.h:53
static String get_namespace(const String &name)
void parse(const fs::path &wsdlFile)
void parseElement(const xdoc::SNode &elementNode)
void generate(const String &sourceDirectory=".", const String &headerFile="", const OpenApiGenerator::Options &options=OpenApiGenerator::Options(), bool verbose=false, const String &serviceNamespace="")
virtual ~WSParser()=default
void generateImplementation(std::ostream &output) const
void parseSchema(const xdoc::SNode &schemaElement)
std::map< String, SWSParserComplexType > WSComplexTypeMap
Definition: WSParserComplexType.h:302
std::map< String, WSOperation > WSOperationMap
Definition: WSOperation.h:56
Definition: OpenApiGenerator.h:56