[breaking] Rename synopsis_options —> generation_options
More consistent.
This commit is contained in:
parent
c86e950847
commit
27fd67bad1
3 changed files with 19 additions and 19 deletions
|
|
@ -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<synopsis_flags>;
|
||||
/// Options that control the generation.
|
||||
using generation_options = type_safe::flag_set<generation_flags>;
|
||||
|
||||
/// 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<code_generator> gen_;
|
||||
type_safe::optional_ref<const cpp_entity> 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 {};
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ inline std::unique_ptr<cppast::cpp_file> 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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue