Add default constructor to libclang_parser

This commit is contained in:
Jonathan Müller 2017-10-30 15:48:50 +01:00
commit 6f128da87f
3 changed files with 9 additions and 0 deletions

View file

@ -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<const diagnostic_logger> logger);
~libclang_parser() noexcept override;
private:

View file

@ -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 <class FileParser>
void resolve_includes(FileParser& parser, const cpp_file& file,
typename FileParser::config config)

View file

@ -330,6 +330,8 @@ struct libclang_parser::impl
}
};
libclang_parser::libclang_parser() : libclang_parser(default_logger()) {}
libclang_parser::libclang_parser(type_safe::object_ref<const diagnostic_logger> logger)
: parser(logger), pimpl_(new impl)
{