Add serialization example

This commit is contained in:
Jonathan Müller 2017-10-31 19:28:24 +01:00
commit 9329fc75ec
6 changed files with 174 additions and 26 deletions

View file

@ -13,7 +13,7 @@
// parses all files in that directory
// and invokes the callback for each of them
template <typename Callback>
int example_main(int argc, char* argv[], const cppast::cpp_entity_index& index, Callback cb)
int example_main(int argc, char* argv[], const cppast::cpp_entity_index& index, Callback cb) try
{
if (argc != 2)
{
@ -47,5 +47,10 @@ int example_main(int argc, char* argv[], const cppast::cpp_entity_index& index,
return 0;
}
catch (std::exception& ex)
{
std::cerr << ex.what() << '\n';
return 1;
}
#endif // CPPAST_EXAMPLE_PARSER_HPP_INCLUDED