Skip to content

Convert std::map and std::unordered_map to JSON object #45

Open
@Zhu-jiatong

Description

@Zhu-jiatong

While developing a webserver, I discovered that JSON and maps have a lot in common. To be more specific, a key-value pair, where the key is used to retrieve the corresponding value. In addition, it is syntactically similar as well, e.g.,

// map
std::unordered_map<String, String> my_map;
my_map["first element"] = "text string";

// JSON
JSONVar my_JSON;
my_JSON["key"] = "value";

Please consider adding a feature to convert a std::map/unordered_map to a JSONVar. This feature could be used in many cases, e.g., serialise user information, file information and device information to be stored in a file or sent across the Internet. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions