AWS SDK for C++

AWS SDK for C++ Version 1.11.606

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
214 private:
215 void Destroy();
216 Document(cJSON* value);
217 cJSON* m_json;
218 bool m_wasParseSuccessful;
219 Aws::String m_errorMessage;
220 friend DocumentView;
221 };
222
229 class AWS_CORE_API DocumentView
230 {
231 public:
232 /* constructors */
234 DocumentView(const Document& value);
236
248 bool IsString() const;
249
253 bool GetBool(const Aws::String& key) const;
257 bool AsBool() const;
261 bool IsBool() const;
262
267 int GetInteger(const Aws::String& key) const;
271 int AsInteger() const;
276 bool IsIntegerType() const;
277
281 Document& AsInt64(long long value);
286 int64_t GetInt64(const Aws::String& key) const;
290 int64_t AsInt64() const;
291
295 double GetDouble(const Aws::String& key) const;
299 double AsDouble() const;
304
316 bool IsListType() const;
317
334 bool IsObject() const;
335
339 bool IsNull() const;
340
345 bool ValueExists(const Aws::String& key) const;
346
350 bool KeyExists(const Aws::String& key) const;
351
356
361
366 private:
367 DocumentView(cJSON* value);
368 DocumentView& operator=(cJSON* value);
369 cJSON* m_json;
371 };
372
373 } // namespace Utils
374} // 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)
Aws::Utils::Json::JsonValue Jsonize() const
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