xuzhenbao commented on code in PR #743: URL: https://github.com/apache/celix/pull/743#discussion_r1568846210
########## libs/utils/include/celix_properties.h: ########## @@ -936,6 +936,348 @@ CELIX_UTILS_EXPORT bool celix_propertiesIterator_equals(const celix_properties_i !celix_propertiesIterator_isEnd(&(iterName)); \ celix_propertiesIterator_next(&(iterName))) +/** + * @brief Flag to indicate that the encoded output should be pretty; e.g. encoded with additional whitespaces, + * newlines and indentation. + * + * If this flag is not set, the encoded output will compact; e.g. without additional whitespaces, newlines and + * indentation. + */ +#define CELIX_PROPERTIES_ENCODE_PRETTY 0x01 + +/** + * @brief Flag to indicate that the encoded output should be flat; e.g. all properties entries are written as top level + * field entries. + * + * E.g: + * @code{.c} + * celix_properties_t* properties = celix_properties_create(); + * celix_properties_setString(properties, "key/with/slash", "value1"); + * celix_properties_setString(properties, "key", "value2"); + * char* json; + * celix_properties_saveToString(properties, CELIX_PROPERTIES_ENCODE_FLAT, &json); + * // json will be: {"key/with/slash": "value1", "key": "value2"} + * @endcode + * + * Note that encoding with a flat encoding style, all properties keys are unique JSON keys and can be written. + * + * If no encoding style flag is set, the encoded output will use the default encoding style. + */ +#define CELIX_PROPERTIES_ENCODE_FLAT_STYLE 0x02 + +/** + * @brief Flag to indicate that the encoded output should be nested; e.g. properties entries are split on '/' and nested Review Comment: In our code, the properties keys are split with '.', e.g:"service.id", why they are split on '/' here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org