From 7e124ec47bc98c359e8652984ffaee9580f99bd1 Mon Sep 17 00:00:00 2001 From: Daniel Sipka Date: Sun, 12 Apr 2015 15:35:13 +0200 Subject: [PATCH] use hpp extension for headers --- include/mstch/{mstch.h => mstch.hpp} | 0 src/mstch.cpp | 4 ++-- src/render_context.cpp | 4 ++-- src/{render_context.h => render_context.hpp} | 4 ++-- src/state/in_inverted_section.cpp | 12 ++++++------ ...in_inverted_section.h => in_inverted_section.hpp} | 2 +- src/state/in_section.cpp | 8 ++++---- src/state/{in_section.h => in_section.hpp} | 2 +- src/state/outside_section.cpp | 10 +++++----- src/state/{outside_section.h => outside_section.hpp} | 2 +- src/state/{render_state.h => render_state.hpp} | 2 +- src/token.cpp | 4 ++-- src/{token.h => token.hpp} | 0 src/utils.cpp | 2 +- src/{utils.h => utils.hpp} | 0 src/visitor/is_node_empty.cpp | 2 +- src/visitor/{is_node_empty.h => is_node_empty.hpp} | 2 +- src/visitor/render_node.cpp | 4 ++-- src/visitor/{render_node.h => render_node.hpp} | 2 +- src/visitor/render_section.cpp | 4 ++-- src/visitor/{render_section.h => render_section.hpp} | 4 ++-- src/visitor/to_json.cpp | 2 +- src/visitor/{to_json.h => to_json.hpp} | 4 ++-- test/CMakeLists.txt | 10 +++++----- test/test_main.cpp | 4 ++-- 25 files changed, 47 insertions(+), 47 deletions(-) rename include/mstch/{mstch.h => mstch.hpp} (100%) rename src/{render_context.h => render_context.hpp} (94%) rename src/state/{in_inverted_section.h => in_inverted_section.hpp} (95%) rename src/state/{in_section.h => in_section.hpp} (95%) rename src/state/{outside_section.h => outside_section.hpp} (92%) rename src/state/{render_state.h => render_state.hpp} (95%) rename src/{token.h => token.hpp} (100%) rename src/{utils.h => utils.hpp} (100%) rename src/visitor/{is_node_empty.h => is_node_empty.hpp} (95%) rename src/visitor/{render_node.h => render_node.hpp} (96%) rename src/visitor/{render_section.h => render_section.hpp} (94%) rename src/visitor/{to_json.h => to_json.hpp} (92%) diff --git a/include/mstch/mstch.h b/include/mstch/mstch.hpp similarity index 100% rename from include/mstch/mstch.h rename to include/mstch/mstch.hpp diff --git a/src/mstch.cpp b/src/mstch.cpp index 7d5d7fe..795365d 100644 --- a/src/mstch.cpp +++ b/src/mstch.cpp @@ -1,8 +1,8 @@ #include #include -#include "mstch/mstch.h" -#include "render_context.h" +#include "mstch/mstch.hpp" +#include "render_context.hpp" using namespace mstch; diff --git a/src/render_context.cpp b/src/render_context.cpp index 2350704..ce598f8 100644 --- a/src/render_context.cpp +++ b/src/render_context.cpp @@ -1,5 +1,5 @@ -#include "render_context.h" -#include "state/outside_section.h" +#include "render_context.hpp" +#include "state/outside_section.hpp" #include diff --git a/src/render_context.h b/src/render_context.hpp similarity index 94% rename from src/render_context.h rename to src/render_context.hpp index 579d5b7..d2f7d42 100644 --- a/src/render_context.h +++ b/src/render_context.hpp @@ -5,8 +5,8 @@ #include #include -#include "mstch/mstch.h" -#include "state/render_state.h" +#include "mstch/mstch.hpp" +#include "state/render_state.hpp" namespace mstch { class render_context { diff --git a/src/state/in_inverted_section.cpp b/src/state/in_inverted_section.cpp index 2aef5da..a54d2a2 100644 --- a/src/state/in_inverted_section.cpp +++ b/src/state/in_inverted_section.cpp @@ -1,9 +1,9 @@ -#include -#include -#include "visitor/is_node_empty.h" -#include "in_inverted_section.h" -#include "outside_section.h" -#include "render_context.h" +#include "visitor/render_section.hpp" +#include "visitor/to_json.hpp" +#include "visitor/is_node_empty.hpp" +#include "in_inverted_section.hpp" +#include "outside_section.hpp" +#include "render_context.hpp" using namespace mstch; diff --git a/src/state/in_inverted_section.h b/src/state/in_inverted_section.hpp similarity index 95% rename from src/state/in_inverted_section.h rename to src/state/in_inverted_section.hpp index 97ae19a..1b716aa 100644 --- a/src/state/in_inverted_section.h +++ b/src/state/in_inverted_section.hpp @@ -2,7 +2,7 @@ #define _MSTCH_IN_INVERTED_SECTION_H_ #include -#include "render_state.h" +#include "render_state.hpp" namespace mstch { namespace state { diff --git a/src/state/in_section.cpp b/src/state/in_section.cpp index 11ed10c..46c31e3 100644 --- a/src/state/in_section.cpp +++ b/src/state/in_section.cpp @@ -1,7 +1,7 @@ -#include "visitor/is_node_empty.h" -#include "visitor/render_section.h" -#include "in_section.h" -#include "outside_section.h" +#include "visitor/is_node_empty.hpp" +#include "visitor/render_section.hpp" +#include "in_section.hpp" +#include "outside_section.hpp" using namespace mstch; diff --git a/src/state/in_section.h b/src/state/in_section.hpp similarity index 95% rename from src/state/in_section.h rename to src/state/in_section.hpp index be7cbb3..b1503a4 100644 --- a/src/state/in_section.h +++ b/src/state/in_section.hpp @@ -1,7 +1,7 @@ #ifndef _MSTCH_IN_SECTION_H_ #define _MSTCH_IN_SECTION_H_ -#include "render_state.h" +#include "render_state.hpp" #include namespace mstch { diff --git a/src/state/outside_section.cpp b/src/state/outside_section.cpp index 5cbe54c..abc5124 100644 --- a/src/state/outside_section.cpp +++ b/src/state/outside_section.cpp @@ -1,8 +1,8 @@ -#include -#include "outside_section.h" -#include "in_section.h" -#include "in_inverted_section.h" -#include "render_context.h" +#include "visitor/render_node.hpp" +#include "outside_section.hpp" +#include "in_section.hpp" +#include "in_inverted_section.hpp" +#include "render_context.hpp" using namespace mstch; diff --git a/src/state/outside_section.h b/src/state/outside_section.hpp similarity index 92% rename from src/state/outside_section.h rename to src/state/outside_section.hpp index 9d8cb7a..1a97a82 100644 --- a/src/state/outside_section.h +++ b/src/state/outside_section.hpp @@ -1,7 +1,7 @@ #ifndef _MSTCH_OUTSIDE_SECTION_H_ #define _MSTCH_OUTSIDE_SECTION_H_ -#include "render_state.h" +#include "render_state.hpp" namespace mstch { namespace state { diff --git a/src/state/render_state.h b/src/state/render_state.hpp similarity index 95% rename from src/state/render_state.h rename to src/state/render_state.hpp index 8d12d09..32c2aa0 100644 --- a/src/state/render_state.h +++ b/src/state/render_state.hpp @@ -2,7 +2,7 @@ #define _MSTCH_RENDER_STATE_H_ #include -#include +#include "token.hpp" namespace mstch { class render_context; diff --git a/src/token.cpp b/src/token.cpp index 7d1611b..511b3e7 100644 --- a/src/token.cpp +++ b/src/token.cpp @@ -1,6 +1,6 @@ -#include "token.h" +#include "token.hpp" -#include "utils.h" +#include "utils.hpp" #include #include diff --git a/src/token.h b/src/token.hpp similarity index 100% rename from src/token.h rename to src/token.hpp diff --git a/src/utils.cpp b/src/utils.cpp index eec8860..558c2c7 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,4 +1,4 @@ -#include "utils.h" +#include "utils.hpp" #include diff --git a/src/utils.h b/src/utils.hpp similarity index 100% rename from src/utils.h rename to src/utils.hpp diff --git a/src/visitor/is_node_empty.cpp b/src/visitor/is_node_empty.cpp index 6aa9988..2ee8c64 100644 --- a/src/visitor/is_node_empty.cpp +++ b/src/visitor/is_node_empty.cpp @@ -1,4 +1,4 @@ -#include "is_node_empty.h" +#include "is_node_empty.hpp" using namespace mstch; diff --git a/src/visitor/is_node_empty.h b/src/visitor/is_node_empty.hpp similarity index 95% rename from src/visitor/is_node_empty.h rename to src/visitor/is_node_empty.hpp index 68a47c6..057b2db 100644 --- a/src/visitor/is_node_empty.h +++ b/src/visitor/is_node_empty.hpp @@ -4,7 +4,7 @@ #include #include -#include "mstch/mstch.h" +#include "mstch/mstch.hpp" namespace mstch { namespace visitor { diff --git a/src/visitor/render_node.cpp b/src/visitor/render_node.cpp index 33924cc..0ec94da 100644 --- a/src/visitor/render_node.cpp +++ b/src/visitor/render_node.cpp @@ -1,5 +1,5 @@ -#include -#include "render_node.h" +#include "utils.hpp" +#include "render_node.hpp" using namespace mstch; diff --git a/src/visitor/render_node.h b/src/visitor/render_node.hpp similarity index 96% rename from src/visitor/render_node.h rename to src/visitor/render_node.hpp index ecc4045..449eb7a 100644 --- a/src/visitor/render_node.h +++ b/src/visitor/render_node.hpp @@ -4,7 +4,7 @@ #include #include -#include "mstch/mstch.h" +#include "mstch/mstch.hpp" #include namespace mstch { diff --git a/src/visitor/render_section.cpp b/src/visitor/render_section.cpp index 173a524..5fc0c82 100644 --- a/src/visitor/render_section.cpp +++ b/src/visitor/render_section.cpp @@ -1,5 +1,5 @@ -#include "render_section.h" -#include "is_node_empty.h" +#include "render_section.hpp" +#include "is_node_empty.hpp" using namespace mstch; diff --git a/src/visitor/render_section.h b/src/visitor/render_section.hpp similarity index 94% rename from src/visitor/render_section.h rename to src/visitor/render_section.hpp index 1c6c84a..729448d 100644 --- a/src/visitor/render_section.h +++ b/src/visitor/render_section.hpp @@ -3,10 +3,10 @@ #include #include -#include +#include "render_context.hpp" #include -#include "mstch/mstch.h" +#include "mstch/mstch.hpp" namespace mstch { namespace visitor { diff --git a/src/visitor/to_json.cpp b/src/visitor/to_json.cpp index c37b72d..6ee3b27 100644 --- a/src/visitor/to_json.cpp +++ b/src/visitor/to_json.cpp @@ -1,4 +1,4 @@ -#include "to_json.h" +#include "to_json.hpp" using namespace mstch; diff --git a/src/visitor/to_json.h b/src/visitor/to_json.hpp similarity index 92% rename from src/visitor/to_json.h rename to src/visitor/to_json.hpp index a36419e..2ece4a1 100644 --- a/src/visitor/to_json.h +++ b/src/visitor/to_json.hpp @@ -3,9 +3,9 @@ #include #include -#include +#include "render_context.hpp" -#include "mstch/mstch.h" +#include "mstch/mstch.hpp" namespace mstch { namespace visitor { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 737051d..d9fe87d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,13 +27,13 @@ foreach(string_file ${string_files}) endforeach(string_file) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_data.h - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/filetoheader --output ${CMAKE_CURRENT_BINARY_DIR}/test_data.h --namespace mstchtest ${genargs} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_data.hpp + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/filetoheader --output ${CMAKE_CURRENT_BINARY_DIR}/test_data.hpp --namespace mstchtest ${genargs} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/filetoheader WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test/data/) -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/test_data.h PROPERTIES GENERATED TRUE) -add_custom_target(test_data_h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_data.h) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/test_data.hpp PROPERTIES GENERATED TRUE) +add_custom_target(test_data_hpp DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_data.hpp) add_executable(mstch_test test_main.cpp) target_link_libraries(mstch_test mstch) -add_dependencies(mstch_test test_data_h) +add_dependencies(mstch_test test_data_hpp) diff --git a/test/test_main.cpp b/test/test_main.cpp index aebdf16..dda9379 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,9 +1,9 @@ #define CATCH_CONFIG_MAIN #include -#include +#include "mstch/mstch.hpp" -#include "test_data.h" +#include "test_data.hpp" #define MSTCH_TEST(x,y) TEST_CASE(x) { REQUIRE(y ## _txt == mstch::render(y ## _mustache, y ## _data)); }