First pass clean reading API.

* include/abg-reader.h (read_file): Remove extraneous file parameter.
	* src/abg-reader.cc: Same.
	* tests/test-read-write.cc: Adjust.
This commit is contained in:
Benjamin Kosnik 2013-08-06 15:42:33 -07:00 committed by Dodji Seketeli
parent f7fd078486
commit 32ce30a23c
4 changed files with 5 additions and 6 deletions

View File

@ -31,7 +31,7 @@ namespace abigail
namespace reader
{
bool
read_file(const std::string& file_path, translation_unit& tu);
read_file(translation_unit& tu);
}// end namespace reader
}// end namespace abigail

View File

@ -486,10 +486,9 @@ static bool handle_function_template_decl(read_context&);
static bool handle_class_template_decl(read_context&);
bool
read_file(const string& file_path,
translation_unit& tu)
read_file(translation_unit& tu)
{
read_context read_ctxt(xml::new_reader_from_file(file_path));
read_context read_ctxt(xml::new_reader_from_file(tu.get_path()));
return read_input(read_ctxt, tu);
}

View File

@ -144,7 +144,7 @@ main()
string input_suffix(s->in_path);
in_path = abigail::tests::get_src_dir() + "/tests/" + input_suffix;
abigail::translation_unit tu(input_suffix);
if (!abigail::reader::read_file(in_path, tu))
if (!abigail::reader::read_file(tu))
{
cerr << "failed to read " << in_path << "\n";
is_ok = false;

View File

@ -50,7 +50,7 @@ main(int argc, char **argv)
string file_name = argv[1];
abigail::translation_unit tu(file_name);
if (!abigail::reader::read_file(file_name, tu))
if (!abigail::reader::read_file(tu))
{
cerr << "failed to read " << file_name << "\n";
return 1;