yaml-cpp/test
Pras Velagapudi ff9a466152 Add an into() operator on Node to do optional assignment.
This adds an `into()` operator to the Node class modeled off
the `get_to()` operator in the popular nlohmann::json library.
(See: https://github.com/nlohmann/json#basic-usage)

This operator assigns a casted value to an existing variable
if that node has a defined value, and otherwise leaves the
variable unchanged.  It returns `true` if the variable was
overwritten and `false` if the variable was unchanged.

This operator is extremely useful in applications where YAML
is being used as a configuration source that overrides
default values coming from another source, e.g.:

```c++
struct MyConfig {
  int foo = 4;
  double bar = 5.0;
  std::string baz = "six";
};

MyConfig config;
node["foo"].into(config.foo);
node["bar"].into(config.bar);

if (!node["baz"].into(config.baz))
  std::cerr << "Using default value for .baz!" << std::endl;
```
2021-11-25 09:30:53 -05:00
..
gtest-1.10.0 Bump minimum cmake versions in gtest to eliminate cmake deprecation warnings. (#1012) 2021-07-15 16:08:00 -05:00
integration Prevent trailing spaces when emitting literal strings (#1005) 2021-07-04 22:30:04 -05:00
node Add an into() operator on Node to do optional assignment. 2021-11-25 09:30:53 -05:00
binary_test.cpp Use static_cast<unsigned char> on DecodeBase64 to prevent SEGV on negative values (#1051) 2021-10-20 10:18:08 -05:00
BUILD.bazel Add bazel Support (#724) 2019-09-27 10:11:38 -05:00
CMakeLists.txt Update Google Test to v1.10.0 (#840) 2020-03-28 19:53:13 -05:00
create-emitter-tests.py Add optional OnAnchor method to EventHandler (#530) 2019-03-12 15:24:32 -07:00
handler_test.h Factored out HandlerTest as a base class 2014-03-23 16:26:44 -05:00
main.cpp Convert node tests to gtest 2014-03-23 19:21:13 -05:00
mock_event_handler.h Small readability improvements in Parser 2019-11-23 13:17:02 -06:00
ostream_wrapper_test.cpp Refactor CMake to use more modern paradigms (#741) 2019-09-27 09:59:53 -05:00
parser_test.cpp Fix stack overflow (#807) 2020-04-09 13:02:10 -05:00
regex_test.cpp Apply formatting/style tweaks to comply with compile time diagnostics for g++ and clang++ (#686) 2019-03-13 15:18:34 -07:00
specexamples.h Supplement test cases for 2.19 ~ 2.22 schema tags. (#857) 2020-05-12 13:20:45 -05:00