Skip to content

It's not a bug, but how to start Config ? #1

Open

Description

@clabnet

Hi,
thanks for this code, I using it as base for my project.

A simple question : how to start Config class for read/write config values from/to json file ?

Thank's, I learning a lot from you.

Activity

  1. elgatito commented on Jul 20, 2021

    @elgatito
    Contributor

    @clabnet

    Thank's, I learning a lot from you.

    That is not a good idea :) That is my first C++ project, so code is not great.

    A simple question : how to start Config class for read/write config values from/to json file ?

    With json_struct and oatpp to read from json string:

            lh::Config config;
            JS::ParseContext context(body->c_str());
            auto err = context.parseTo(config);
    

    To output as json string:

           JS::serializeStruct(config).c_str()
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions