Add copying of shared library to the output directory with a test binary.
[binary] removed using of non unsigned char as argument at
'std::isspace' function that was provokes undefined behavior.
[.github/workflows/build.yml] enabled run of test at the
'windows-latest' environment.
GNUInstallDirs provided may be absolute paths, in which case appending
to the install prefix is not correct. We can instead use the provided
CMAKE_INSTALL_FULL_* variables, which are precomputed absolute paths.
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
* Export YAML::detail::node::m_amount
The internal header node/detail/node.h is included by public headers;
YAML::detail::node is implemented in the header itself, and thus it gets
inlined... except for its static m_amount class member, which is
instantiated in the library only. Right now all the symbols of yaml-cpp
are exported (nothing is hidden), so the linker will find node::m_amount
in the yaml-cpp library.
As solution/workaround, explicitly export YAML::detail::node::m_amount.
* CMake: use GenerateExportHeader
Make use of the GenerateExportHeader CMake module to generate the dll.h
header with export macros.
While the produced dll.h is different, the result should be the same,
i.e. nothing changes for yaml-cpp or its users.
* CMake: hide all the symbols by default
Hide all the symbols that are not explicitly exported with YAML_CPP_API.
This way the ABI will be way smaller, and only actually exposing the
public classes/functions.
- Don't eagerly convert key to std::string
- Make const char* keys streamable when exception is thrown
- Don't create a temporary string when comparing a const char* key
For completeness I've implemented escaping for characters outside the
basic multilingual plane, but it doesn't get used (as there's no
EscapeAsAsciiJson emitter option implemented).
Inside of a sequence or map, `YAML::Newline` wouldn't reset the collection state, which would cause behavior like this:
```
nodeA:
k: [{i: 0},
{i:1},
]NodeB:
k: [{i: 0},
{i:1},
]
```
* partially fix clang compilation
Missing header and mistaken algorithm usage.
Also removed it name from range loops. It's not correct.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* run through clang's -Wrange-loop-analysis
Some range loops should not use references as they need to copy.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* manual range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>