diff --git a/include/cppast/libclang_parser.hpp b/include/cppast/libclang_parser.hpp index 5b02037..90eba16 100644 --- a/include/cppast/libclang_parser.hpp +++ b/include/cppast/libclang_parser.hpp @@ -164,7 +164,12 @@ namespace cppast public: using config = libclang_compile_config; + /// \effects Creates a parser using the default logger. + libclang_parser(); + + /// \effects Creates a parser that will log error messages using the specified logger. explicit libclang_parser(type_safe::object_ref logger); + ~libclang_parser() noexcept override; private: diff --git a/include/cppast/parser.hpp b/include/cppast/parser.hpp index 84badba..67cbcd9 100644 --- a/include/cppast/parser.hpp +++ b/include/cppast/parser.hpp @@ -187,6 +187,8 @@ namespace cppast [&](const std::string&) { return config; }); } + /// Parses all files included by `file`. + /// \effects For each [cppast::cpp_include_directive]() in file it will parse the included file. template void resolve_includes(FileParser& parser, const cpp_file& file, typename FileParser::config config) diff --git a/src/libclang/libclang_parser.cpp b/src/libclang/libclang_parser.cpp index 65ab58c..e40abe9 100644 --- a/src/libclang/libclang_parser.cpp +++ b/src/libclang/libclang_parser.cpp @@ -330,6 +330,8 @@ struct libclang_parser::impl } }; +libclang_parser::libclang_parser() : libclang_parser(default_logger()) {} + libclang_parser::libclang_parser(type_safe::object_ref logger) : parser(logger), pimpl_(new impl) {