Commit d5cbec33 authored by amdmi3's avatar amdmi3
Browse files

A C++ implementation of the HOCON configuration file format.

WWW: https://github.com/puppetlabs/cpp-hocon

PR:		213763
Submitted by:	jslagle@gmail.com
parent d9be2389
--- lib/inc/hocon/parser/config_node.hpp.orig 2016-09-23 20:45:10 UTC
+++ lib/inc/hocon/parser/config_node.hpp
@@ -18,7 +18,7 @@ namespace hocon {
* Also, this interface is likely to grow new methods over time, so third-party
* implementations will break.
*/
- class LIBCPP_HOCON_EXPORT config_node {
+ class CPP_HOCON_EXPORT config_node {
public:
/**
* The original text of the input which was used to form this particular
--- lib/inc/hocon/path.hpp.orig 2016-09-23 20:45:10 UTC
+++ lib/inc/hocon/path.hpp
@@ -10,7 +10,7 @@
namespace hocon {
- class LIBCPP_HOCON_EXPORT path {
+ class CPP_HOCON_EXPORT path {
public:
path();
explicit path(std::string first, path const& remainder);
--- lib/src/config_value_factory.cc.orig 2016-09-23 20:45:10 UTC
+++ lib/src/config_value_factory.cc
@@ -17,27 +17,27 @@ namespace hocon {
// TODO: If use cases of from_any_ref require other types to produce config_nulls,
// we can revise this behavior
shared_value operator()(boost::blank null_value) const {
- return make_shared<const config_null>(nullptr);
+ return make_shared<config_null>(nullptr);
}
shared_value operator()(string str) const {
- return make_shared<const config_string>(nullptr, str, config_string_type::QUOTED);
+ return make_shared<config_string>(nullptr, str, config_string_type::QUOTED);
}
shared_value operator()(int64_t num) const {
- return make_shared<const config_long>(nullptr, num, "");
+ return make_shared<config_long>(nullptr, num, "");
}
shared_value operator()(double num) const {
- return make_shared<const config_double>(nullptr, num, "");
+ return make_shared<config_double>(nullptr, num, "");
}
shared_value operator()(int num) const {
- return make_shared<const config_int>(nullptr, num, "");
+ return make_shared<config_int>(nullptr, num, "");
}
shared_value operator()(bool boolean) const {
- return make_shared<const config_boolean>(nullptr, boolean);
+ return make_shared<config_boolean>(nullptr, boolean);
}
shared_value operator()(vector<unwrapped_value> value_list) const {
@@ -45,7 +45,7 @@ namespace hocon {
for (unwrapped_value v : value_list) {
config_values.emplace_back(boost::apply_visitor(config_value_visitor(), v));
}
- return make_shared<const simple_config_list>(nullptr, config_values);
+ return make_shared<simple_config_list>(nullptr, config_values);
}
shared_value operator()(unordered_map<string, unwrapped_value> value_map) const {
@@ -53,7 +53,7 @@ namespace hocon {
for (auto pair : value_map) {
config_map[pair.first] = boost::apply_visitor(config_value_visitor(), pair.second);
}
- return make_shared<const simple_config_object>(nullptr, config_map);
+ return make_shared<simple_config_object>(nullptr, config_map);
}
};
@@ -62,7 +62,7 @@ namespace hocon {
if (origin.empty()) {
origin = "hardcoded value";
}
- auto conf_origin = make_shared<const simple_config_origin>(origin);
+ auto conf_origin = make_shared<simple_config_origin>(origin);
return boost::apply_visitor(config_value_visitor(), value)->with_origin(conf_origin);
}
} // namespace hocon
--- lib/tests/CMakeLists.txt.orig 2016-09-23 20:45:10 UTC
+++ lib/tests/CMakeLists.txt
@@ -18,23 +18,23 @@ set(TEST_CASES
program_options.cc
)
-add_executable(lib${PROJECT_NAME}_test $<TARGET_OBJECTS:libprojectsrc> ${TEST_CASES} main.cc)
+add_executable(${PROJECT_NAME}_test $<TARGET_OBJECTS:libprojectsrc> ${TEST_CASES} main.cc)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- target_link_libraries(lib${PROJECT_NAME}_test rt)
+ target_link_libraries(${PROJECT_NAME}_test rt)
endif()
-target_link_libraries(lib${PROJECT_NAME}_test
+target_link_libraries(${PROJECT_NAME}_test
${Boost_LIBRARIES}
${LEATHERMAN_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND BOOST_STATIC AND LEATHERMAN_USE_LOCALES)
- target_link_libraries(lib${PROJECT_NAME}_test iconv)
+ target_link_libraries(${PROJECT_NAME}_test iconv)
endif()
-add_test(NAME "unit_tests" COMMAND lib${PROJECT_NAME}_test)
+add_test(NAME "unit_tests" COMMAND ${PROJECT_NAME}_test)
configure_file (
"${CMAKE_CURRENT_LIST_DIR}/fixtures.hpp.in"
--- lib/tests/config_value_test.cc.orig 2016-09-23 20:45:10 UTC
+++ lib/tests/config_value_test.cc
@@ -91,7 +91,7 @@ TEST_CASE("config object unwraps") {
auto value2 = config_int::new_number(fake_origin(), int64_t(2), "2");
auto value3 = config_int::new_number(fake_origin(), int64_t(3), "3");
unordered_map<string, shared_value> org {{"a", value1}, {"b", value2}, {"c", value3}};
- auto obj = make_shared<const simple_config_object>(fake_origin(), org);
+ auto obj = make_shared<simple_config_object>(fake_origin(), org);
unordered_map<string, unwrapped_value> map {{"a", 1}, {"b", 2}, {"c", 3}};
unwrapped_value expected(map);
bool test = expected == obj->unwrapped();
@@ -103,7 +103,7 @@ TEST_CASE("config list unwraps") {
auto value2 = config_int::new_number(fake_origin(), int64_t(2), "2");
auto value3 = config_int::new_number(fake_origin(), int64_t(3), "3");
vector<shared_value> data { value1, value2, value3 };
- auto list = make_shared<const simple_config_list>(fake_origin(), data);
+ auto list = make_shared<simple_config_list>(fake_origin(), data);
vector<unwrapped_value> v { 1,2,3 };
unwrapped_value expected(v);
bool test = expected == list->unwrapped();
A C++ implementation of the HOCON configuration file format.
WWW: https://github.com/puppetlabs/cpp-hocon
include/hocon/config.hpp
include/hocon/config_exception.hpp
include/hocon/config_include_context.hpp
include/hocon/config_includer.hpp
include/hocon/config_includer_file.hpp
include/hocon/config_list.hpp
include/hocon/config_mergeable.hpp
include/hocon/config_object.hpp
include/hocon/config_origin.hpp
include/hocon/config_parse_options.hpp
include/hocon/config_parseable.hpp
include/hocon/config_render_options.hpp
include/hocon/config_resolve_options.hpp
include/hocon/config_syntax.hpp
include/hocon/config_value.hpp
include/hocon/config_value_factory.hpp
include/hocon/config_value_factory.hpp.orig
include/hocon/export.h
include/hocon/functional_list.hpp
include/hocon/parser/config_document.hpp
include/hocon/parser/config_document_factory.hpp
include/hocon/parser/config_node.hpp
include/hocon/path.hpp
include/hocon/program_options.hpp
include/hocon/types.hpp
include/hocon/version.h
lib/libcpp-hocon.so
lib/libcpp-hocon.so.0.1.2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment