AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
Document.h
1
6#pragma once
7
8#include <aws/core/Core_EXPORTS.h>
9
10#include <aws/core/utils/Array.h>
11#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
12#include <aws/core/utils/memory/stl/AWSString.h>
13#include <aws/core/utils/memory/stl/AWSMap.h>
14#include <aws/core/external/cjson/cJSON.h>
15
16#include <utility>
17
18namespace Aws
19{
20 namespace Utils
21 {
22 namespace Json
23 {
24 class JsonValue;
25 class JsonView;
26 }
27
28 class DocumentView;
35 class AWS_CORE_API Document
36 {
37 public:
42
46 Document(const Aws::String& value);
47
52
57 Document(const Document& value);
58
64
69
71
75 Document& operator=(const Document& other);
76
81
90
91 bool operator==(const Document& other) const;
92 bool operator!=(const Document& other) const;
93
97 Document& WithString(const Aws::String& key, const Aws::String& value);
98 Document& WithString(const char* key, const Aws::String& value);
103
107 Document& WithBool(const Aws::String& key, bool value);
108 Document& WithBool(const char* key, bool value);
112 Document& AsBool(bool value);
113
117 Document& WithInteger(const Aws::String& key, int value);
118 Document& WithInteger(const char* key, int value);
122 Document& AsInteger(int value);
123
127 Document& WithInt64(const Aws::String& key, long long value);
128 Document& WithInt64(const char* key, long long value);
132 Document& AsInt64(long long value);
133
137 Document& WithDouble(const Aws::String& key, double value);
138 Document& WithDouble(const char* key, double value);
142 Document& AsDouble(double value);
143
148 Document& WithArray(const char* key, const Array<Aws::String>& array);
153 Document& WithArray(const Aws::String& key, const Array<Document>& array);
167
172 Document& WithObject(const Aws::String& key, const Document& value);
173 Document& WithObject(const char* key, const Document& value);
178 Document& WithObject(const char* key, Document&& value);
182 Document& AsObject(const Document& value);
187
192 inline bool WasParseSuccessful() const
193 {
194 return m_wasParseSuccessful;
195 }
196
200 inline const Aws::String& GetErrorMessage() const
201 {
202 return m_errorMessage;
203 }
204
209
210 private:
211 void Destroy();
212 Document(cJSON* value);
213 cJSON* m_json;
214 bool m_wasParseSuccessful;
215 Aws::String m_errorMessage;
216 friend DocumentView;
217 };
218
225 class AWS_CORE_API DocumentView
226 {
227 public:
228 /* constructors */
230 DocumentView(const Document& value);
232
244 bool IsString() const;
245
249 bool GetBool(const Aws::String& key) const;
253 bool AsBool() const;
257 bool IsBool() const;
258
263 int GetInteger(const Aws::String& key) const;
267 int AsInteger() const;
272 bool IsIntegerType() const;
273
277 Document& AsInt64(long long value);
282 int64_t GetInt64(const Aws::String& key) const;
286 int64_t AsInt64() const;
287
291 double GetDouble(const Aws::String& key) const;
295 double AsDouble() const;
300
312 bool IsListType() const;
313
330 bool IsObject() const;
331
335 bool IsNull() const;
336
341 bool ValueExists(const Aws::String& key) const;
342
346 bool KeyExists(const Aws::String& key) const;
347
352
357
362 private:
363 DocumentView(cJSON* value);
364 DocumentView& operator=(cJSON* value);
365 cJSON* m_json;
367 };
368
369 } // namespace Utils
370} // namespace Aws
Document & AsInteger(int value)
Document & WithObject(const char *key, Document &&value)
Document(const Json::JsonView &view)
DocumentView View() const
Document & AsInt64(long long value)
Document & WithString(const Aws::String &key, const Aws::String &value)
Document & WithInteger(const char *key, int value)
Document & operator=(Document &&other)
Document & WithInt64(const char *key, long long value)
Document & WithArray(const char *key, const Array< Aws::String > &array)
Document & AsDouble(double value)
Document & WithObject(const Aws::String &key, const Document &value)
Document & WithArray(const Aws::String &key, Array< Document > &&array)
bool operator!=(const Document &other) const
Document & WithInteger(const Aws::String &key, int value)
bool operator==(const Document &other) const
Document & operator=(const Json::JsonView &view)
Document & WithObject(const Aws::String &key, Document &&value)
Document(const Document &value)
Document & AsArray(const Array< Document > &array)
Document & AsObject(const Document &value)
Document & WithString(const char *key, const Aws::String &value)
Document & AsBool(bool value)
bool WasParseSuccessful() const
Definition Document.h:192
Document & WithDouble(const Aws::String &key, double value)
Document & WithBool(const char *key, bool value)
Document & WithDouble(const char *key, double value)
Document & AsObject(Document &&value)
Document & WithArray(const Aws::String &key, const Array< Aws::String > &array)
Document(const Aws::String &value)
const Aws::String & GetErrorMessage() const
Definition Document.h:200
Document & AsArray(Array< Document > &&array)
Document & WithInt64(const Aws::String &key, long long value)
Document & WithObject(const char *key, const Document &value)
Document(Aws::IStream &istream)
Document & AsString(const Aws::String &value)
Document & WithArray(const Aws::String &key, const Array< Document > &array)
Document & operator=(const Document &other)
Document(Document &&value)
Document & WithBool(const Aws::String &key, bool value)
bool GetBool(const Aws::String &key) const
bool KeyExists(const Aws::String &key) const
double GetDouble(const Aws::String &key) const
Array< DocumentView > AsArray() const
Document Materialize() const
Aws::String GetString(const Aws::String &key) const
Aws::String WriteCompact() const
Document & AsInt64(long long value)
Array< DocumentView > GetArray(const Aws::String &key) const
DocumentView AsObject() const
DocumentView & operator=(const Document &value)
Aws::Map< Aws::String, DocumentView > GetAllObjects() const
double AsDouble() const
int64_t GetInt64(const Aws::String &key) const
int64_t AsInt64() const
Aws::String AsString() const
DocumentView GetObject(const Aws::String &key) const
DocumentView(const Document &value)
bool IsFloatingPointType() const
bool ValueExists(const Aws::String &key) const
bool IsIntegerType() const
int GetInteger(const Aws::String &key) const
Aws::String WriteReadable() const
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
Definition AWSMap.h:20
std::basic_istream< char, std::char_traits< char > > IStream
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition AWSString.h:97
Aws::Utils::Json::JsonValue JsonValue
Definition cJSON.h:115