AWS SDK for C++  1.9.1
AWS SDK for C++
XmlSerializer.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
10 #include <aws/core/utils/Outcome.h>
13 
14 namespace Aws
15 {
16  namespace External
17  {
18  namespace tinyxml2
19  {
20  class XMLNode;
21 
22  class XMLDocument;
23  } // namespace tinyxml2
24  } // namespace External
25 } // namespace Aws
26 
27 namespace Aws
28 {
29  template<typename PAYLOAD_TYPE>
30  class AmazonWebServiceResult;
31  namespace Client
32  {
33  enum class CoreErrors;
34  template<typename ERROR_TYPE>
35  class AWSError;
36  class AWSXMLClient;
37  } // namespace Client
38  namespace Utils
39  {
40  namespace Xml
41  {
46 
47  class XmlDocument;
48 
53  {
54  public:
58  XmlNode(const XmlNode& other);
62  XmlNode& operator=(const XmlNode& other);
66  const Aws::String GetName() const;
70  void SetName(const Aws::String& name);
74  const Aws::String GetAttributeValue(const Aws::String& name) const;
78  void SetAttributeValue(const Aws::String& name, const Aws::String& value);
86  void SetText(const Aws::String& textValue);
90  bool HasNextNode() const;
94  XmlNode NextNode() const;
98  XmlNode NextNode(const char* name) const;
102  XmlNode NextNode(const Aws::String& name) const;
110  XmlNode FirstChild(const char* name) const;
114  XmlNode FirstChild(const Aws::String& name) const;
118  bool HasChildren() const;
122  XmlNode Parent() const;
134  bool IsNull();
135 
136  private:
137  XmlNode(Aws::External::tinyxml2::XMLNode* node, const XmlDocument& document) :
138  m_node(node), m_doc(&document)
139  {
140  }
141 
142  //we do not own these.... I just had to change it from ref because the compiler was
143  //confused about which assignment operator to call. Do not... I repeat... do not delete
144  //these pointers in your destructor.
146  const XmlDocument* m_doc;
147 
148  friend class XmlDocument;
149  };
150 
156  {
157  public:
161  XmlDocument(const XmlDocument& other);
164 
167 
169 
182  bool WasParseSuccessful() const;
199 
200  private:
201  void InitDoc();
202 
204 
205  friend class XmlNode;
206 
207  //allow outcome call the default constructor to handle it's error case.
208  friend class Aws::Utils::Outcome<Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>, Aws::Client::AWSError<Aws::Client::CoreErrors>>;
209  friend class Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>;
210  template<typename T>
211  friend class Client::AWSError;
212  friend class Client::AWSXMLClient;
213  };
214 
215  } // namespace Xml
216  } // namespace Utils
217 } // namespace Aws
Aws::IOStream
std::basic_iostream< char, std::char_traits< char > > IOStream
Definition: AWSStreamFwd.h:22
Aws::External::tinyxml2::XMLDocument
Definition: tinyxml2.h:1654
Aws::DirectoryService::Model::LDAPSType::NOT_SET
@ NOT_SET
Aws::Utils::Xml::XmlDocument::operator=
XmlDocument & operator=(XmlDocument &&other)
Aws::AmazonWebServiceResult
Definition: AmazonWebServiceResult.h:19
AWS_CORE_API
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25
Aws::Client::CoreErrors
CoreErrors
Definition: CoreErrors.h:21
Aws::Utils::Xml::XmlNode::NextNode
XmlNode NextNode(const Aws::String &name) const
Aws::Utils::Xml::XmlNode::NextNode
XmlNode NextNode(const char *name) const
Aws::Utils::Xml::XmlDocument::ConvertToString
Aws::String ConvertToString() const
Aws::Utils::Xml::XmlNode::HasChildren
bool HasChildren() const
Aws::Utils::Xml::XmlDocument::operator=
XmlDocument & operator=(const XmlDocument &other)
AWSStreamFwd.h
Aws::Utils::Xml::XmlNode::FirstChild
XmlNode FirstChild(const char *name) const
Aws::External::tinyxml2::XMLNode
Definition: tinyxml2.h:675
Aws::Utils::Xml::XmlNode::Parent
XmlNode Parent() const
Aws::Utils::Xml::XmlNode::SetAttributeValue
void SetAttributeValue(const Aws::String &name, const Aws::String &value)
Aws::Utils::Xml::XmlDocument::WasParseSuccessful
bool WasParseSuccessful() const
Aws::Utils::Xml::XmlDocument::XmlDocument
XmlDocument()
Aws::Utils::Xml::XmlNode
Definition: XmlSerializer.h:53
Aws::Utils::Xml::XmlDocument::~XmlDocument
~XmlDocument()
Aws::Utils::Xml::XmlDocument::CreateFromXmlString
static XmlDocument CreateFromXmlString(const Aws::String &)
Aws::Utils::Xml::XmlNode::GetText
Aws::String GetText() const
Aws::Utils::Xml::XmlDocument::CreateWithRootNode
static XmlDocument CreateWithRootNode(const Aws::String &)
Aws::Utils::Xml::XmlNode::HasNextNode
bool HasNextNode() const
Aws::Utils::Xml::XmlNode::SetText
void SetText(const Aws::String &textValue)
Aws::Utils::Xml::XmlNode::SetName
void SetName(const Aws::String &name)
Outcome.h
Aws::Utils::Xml::XmlNode::GetName
const Aws::String GetName() const
Aws::Utils::Xml::XmlNode::GetAttributeValue
const Aws::String GetAttributeValue(const Aws::String &name) const
AWSString.h
Aws::Utils::Xml::XmlDocument::GetRootElement
XmlNode GetRootElement() const
Aws::Client::AWSError
Definition: AWSError.h:42
Aws::Utils::Xml::XmlDocument
Definition: XmlSerializer.h:156
Aws::Utils::Xml::XmlNode::IsNull
bool IsNull()
Aws::DirectoryService::Model::TrustType::NOT_SET
@ NOT_SET
Aws::Utils::Xml::XmlDocument::XmlDocument
XmlDocument(const XmlDocument &other)
Core_EXPORTS.h
Aws::Utils::Xml::XmlNode::FirstChild
XmlNode FirstChild() const
Aws
Definition: AccessManagementClient.h:15
Aws::Utils::Xml::XmlNode::CreateChildElement
XmlNode CreateChildElement(const Aws::String &name)
Aws::Utils::Outcome
Definition: Outcome.h:26
Aws::Utils::Xml::XmlDocument::XmlDocument
XmlDocument(XmlDocument &&doc)
Aws::String
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
Aws::Utils::Xml::DecodeEscapedXmlText
AWS_CORE_API Aws::String DecodeEscapedXmlText(const Aws::String &textToDecode)
Aws::Utils::Xml::XmlNode::NextNode
XmlNode NextNode() const
Aws::Utils::Xml::XmlDocument::GetErrorMessage
Aws::String GetErrorMessage() const
Aws::Utils::Xml::XmlNode::XmlNode
XmlNode(const XmlNode &other)
Aws::Utils::Xml::XmlNode::CreateSiblingElement
XmlNode CreateSiblingElement(const Aws::String &name)
Aws::Client::AWSXMLClient
Definition: AWSClient.h:388
Aws::Utils::Xml::XmlNode::operator=
XmlNode & operator=(const XmlNode &other)
Aws::Utils::Xml::XmlNode::FirstChild
XmlNode FirstChild(const Aws::String &name) const
Aws::Utils::Xml::XmlDocument::CreateFromXmlStream
static XmlDocument CreateFromXmlStream(Aws::IOStream &)