diff --git a/include/cppast/code_generator.hpp b/include/cppast/code_generator.hpp index 3ed6fb3..53091cf 100644 --- a/include/cppast/code_generator.hpp +++ b/include/cppast/code_generator.hpp @@ -130,8 +130,8 @@ namespace cppast code_generator& operator=(const code_generator&) = delete; virtual ~code_generator() noexcept = default; - /// Flags that control the synopsis. - enum synopsis_flags + /// Flags that control the generation. + enum generation_flags { exclude, //< Exclude the entire entity. exclude_return, //< Exclude the return type of a function entity. @@ -140,8 +140,8 @@ namespace cppast _flag_set_size, //< \exclude }; - /// Options that control the synopsis. - using synopsis_options = type_safe::flag_set; + /// Options that control the generation. + using generation_options = type_safe::flag_set; /// Sentinel type used to output a given entity. class output @@ -184,7 +184,7 @@ namespace cppast } /// \returns The synopsis options. - synopsis_options options() const noexcept + generation_options options() const noexcept { return options_; } @@ -319,7 +319,7 @@ namespace cppast private: type_safe::object_ref gen_; type_safe::optional_ref e_; - synopsis_options options_; + generation_options options_; }; protected: @@ -330,7 +330,7 @@ namespace cppast /// The base class version has no effect. /// \returns The synopsis options for that entity, /// the base class version always returns no special options. - virtual synopsis_options on_container_begin(const cpp_entity& e) + virtual generation_options on_container_begin(const cpp_entity& e) { (void)e; return {}; @@ -347,7 +347,7 @@ namespace cppast /// The base class version has no effect. /// \returns The synopsis options for that entity, /// the base class version always returns no special options. - virtual synopsis_options on_leaf(const cpp_entity& e) + virtual generation_options on_leaf(const cpp_entity& e) { (void)e; return {}; diff --git a/test/test_parser.hpp b/test/test_parser.hpp index 84047f8..70f4c03 100644 --- a/test/test_parser.hpp +++ b/test/test_parser.hpp @@ -45,7 +45,7 @@ inline std::unique_ptr parse(const cppast::cpp_entity_index& i class test_generator : public cppast::code_generator { public: - test_generator(synopsis_options options) : options_(std::move(options)) + test_generator(generation_options options) : options_(std::move(options)) { } @@ -55,12 +55,12 @@ public: } private: - synopsis_options on_container_begin(const cppast::cpp_entity&) override + generation_options on_container_begin(const cppast::cpp_entity&) override { return options_; } - synopsis_options on_leaf(const cppast::cpp_entity&) override + generation_options on_leaf(const cppast::cpp_entity&) override { return options_; } @@ -92,14 +92,14 @@ private: was_newline_ = true; } - std::string str_; - synopsis_options options_; - unsigned indent_ = 0; - bool was_newline_ = false; + std::string str_; + generation_options options_; + unsigned indent_ = 0; + bool was_newline_ = false; }; -inline std::string get_code(const cppast::cpp_entity& e, - cppast::code_generator::synopsis_options options = {}) +inline std::string get_code(const cppast::cpp_entity& e, + cppast::code_generator::generation_options options = {}) { test_generator generator(options); cppast::generate_code(generator, e); diff --git a/tool/main.cpp b/tool/main.cpp index 1e656c4..1704894 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -79,14 +79,14 @@ void print_entity(std::ostream& out, const cppast::cpp_entity& e) private: // called at the beginning of the code generation of a container entity (i.e. one with child) - synopsis_options on_container_begin(const cppast::cpp_entity&) override + generation_options on_container_begin(const cppast::cpp_entity&) override { // generate declaration only return code_generator::declaration; } // called before code generation of a leaf entity - synopsis_options on_leaf(const cppast::cpp_entity&) override + generation_options on_leaf(const cppast::cpp_entity&) override { // generate declaration only return code_generator::declaration;