16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_JSON_JSONUTILS_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_JSON_JSONUTILS_H_ 24 #include <rapidjson/document.h> 54 rapidjson::Value::ConstMemberIterator* iteratorPtr);
123 template <
typename T>
130 rapidjson::Value::ConstMemberIterator iterator;
131 if (!
findNode(jsonNode, key, &iterator)) {
149 template <
typename T>
156 rapidjson::Document document;
190 template <
class CollectionT>
203 template <
class CollectionT>
213 template <
class CollectionT>
222 template <
class CollectionT>
246 std::map<std::string, std::string>& elements);
260 std::vector<std::map<std::string, std::string>>& elements);
265 std::vector<std::string> retrieveStringArray<std::vector<std::string>>(
270 std::vector<std::string> retrieveStringArray<std::vector<std::string>>(
const std::string& jsonString);
273 std::vector<std::string> retrieveStringArray<std::vector<std::string>>(
const rapidjson::Value& value);
276 std::string convertToJsonString<std::vector<std::string>>(
const std::vector<std::string>& elements);
278 template <
class CollectionT>
280 auto values = retrieveStringArray<std::vector<std::string>>(jsonString,
key);
281 return CollectionT{values.begin(), values.end()};
284 template <
class CollectionT>
286 auto values = retrieveStringArray<std::vector<std::string>>(jsonString);
287 return CollectionT{values.begin(), values.end()};
290 template <
class CollectionT>
292 auto values = retrieveStringArray<std::vector<std::string>>(value);
293 return CollectionT{values.begin(), values.end()};
296 template <
class CollectionT>
307 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_JSON_JSONUTILS_H_ std::string convertToJsonString(const CollectionT &elements)
Definition: JSONUtils.h:297
::std::string string
Definition: gtest-port.h:1097
bool retrieveArrayOfStringMapFromArray(const rapidjson::Value &value, const std::string &key, std::vector< std::map< std::string, std::string >> &elements)
CollectionT retrieveStringArray(const std::string &jsonString, const std::string &key)
Definition: JSONUtils.h:279
bool findNode(const rapidjson::Value &jsonNode, const std::string &key, rapidjson::Value::ConstMemberIterator *iteratorPtr)
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
bool retrieveValue(const rapidjson::Value &jsonNode, const std::string &key, T *value)
Definition: JSONUtils.h:124
static std::string getTag()
Definition: JSONUtils.h:37
std::map< std::string, std::string > retrieveStringMap(const rapidjson::Value &value, const std::string &key)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool convertToValue(const rapidjson::Value &documentNode, std::string *value)
void acsdkError(const LogEntry &entry)
void retrieveStringMapFromArray(const rapidjson::Value &value, const std::string &key, std::map< std::string, std::string > &elements)
bool parseJSON(const std::string &jsonContent, rapidjson::Document *document)
bool jsonArrayExists(const rapidjson::Value &parsedDocument, const std::string &key)
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58
LogEntry is used to compile the log entry text to log via Logger.
Definition: LogEntry.h:33