Giter VIP home page Giter VIP logo

config's People

Contributors

bjoe avatar colinh avatar d-frey avatar fakecore avatar mpoeter avatar striezel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

config's Issues

Query all temporaries

Hi and kudos for the awesome library!

Is there a way to do this:

std::string checkTemporary = R"(
(temporary x1)
x1 = 1
(temporary x2)
x2 = 2
(temporary y3)
y3 = 3

(permanent x1)
(permanent x2)

)";


TEST_CASE("Temporary", "[tao]")
{
    tao::json::events::to_value taovalue_consumer;
    auto cnfg = tao::config::from_string(checkTemporary, "test");
    tao::json::events::from_value(taovalue_consumer, cnfg);

    tao::json::nlohmann::to_value<::nlohmann::json> nlohmann_consumer;
    tao::json::events::from_string(nlohmann_consumer, tao::json::to_string(taovalue_consumer.value));

    CHECK(nlohmann_consumer.value.contains("x1"));
    CHECK(nlohmann_consumer.value.contains("x2"));
    CHECK(!nlohmann_consumer.value.contains("y3"));
}

but with something like (permanent x*)?
The use case is that all temporaries with a certain prefix are possible presets. We want to construct a config json with a specific preset for our application by including all the temporaries in one file, and muxing between them when resolving the json without each and every preset appearing in the resolved json - and that's easy; but also to query the list of available temporaries (preset names) by including them in another file and making those with a certain prefix permanent when resolving.

Also, what is the right way to convert to nlohmann::json without going through std::string? Couldn't find it.

Thanks!
Guy.

Using environment variable inside include

First of all, kudos for the awesome library!

I'm wondering if there is a way to use an environment variable result within the include token.
Something like this:
foo = (env "config_path") (include "(foo)/presets.base")
Note: this leads to a parsing error in the include token...
Or there is another way to get this done?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.