X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fbuilder%2Fbase64-encoding.h;h=c436c54fbe39246d126b40846afb4436f8840a02;hp=c7067ed333d6c967c1f3f3debbe5ec41e1df2bf3;hb=HEAD;hpb=554ceadad196d0607459efb54f0ce312240d4b44 diff --git a/dali-toolkit/devel-api/builder/base64-encoding.h b/dali-toolkit/devel-api/builder/base64-encoding.h index c7067ed..566bded 100644 --- a/dali-toolkit/devel-api/builder/base64-encoding.h +++ b/dali-toolkit/devel-api/builder/base64-encoding.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_BASE64_ENCODING_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include // INTERNAL INCLUDES #include @@ -56,6 +57,18 @@ DALI_TOOLKIT_API bool DecodeBase64PropertyData(const Property::Value& value, std DALI_TOOLKIT_API bool DecodeBase64PropertyData(const Property::Value& value, std::vector& outputData); /** + * @brief Parses a std::string_view to retrieve an array of uint8_t data. + * + * Data can be encoded using the base64 encoding scheme to allow it to be used + * in JSON (The property system maps to JSON types). + * + * @param[in] encodedString The input string to decode + * @param[out] outputData The output data block + * @return True if a data block was decoded successfully. + */ +DALI_TOOLKIT_API bool DecodeBase64FromString(const std::string_view& encodedString, std::vector& outputData); + +/** * @brief Convert a block of uint32_t data into a Property::STRING or ARRAY of STRINGs * encoded using base64. This allows the data to be mapped to JSON easily. * @@ -64,6 +77,15 @@ DALI_TOOLKIT_API bool DecodeBase64PropertyData(const Property::Value& value, std */ DALI_TOOLKIT_API void EncodeBase64PropertyData(Property::Value& value, const std::vector& inputData); +/** + * @brief Convert a block of uint8_t data into a Property::STRING or ARRAY of STRINGs + * encoded using base64. This allows the data to be mapped to JSON easily. + * + * @param[out] value The value to write data into (to avoid copying). + * @param[in] inputData The input + */ +DALI_TOOLKIT_API void EncodeBase64PropertyData(Property::Value& value, const std::vector& inputData); + } // namespace Toolkit } // namespace Dali