const bool annotate = false);
bool
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- write_context& ctxt);
+write_corpus_group(write_context& ctx,
+ const corpus_group_sptr& group,
+ unsigned indent);
-bool
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- std::ostream& out,
- const bool annotate = false);
+bool ABG_DEPRECATED
+write_corpus_group(const corpus_group_sptr& group,
+ unsigned indent,
+ write_context& ctxt);
-bool
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- const string& path,
- const bool annotate = false);
+bool ABG_DEPRECATED
+write_corpus_group(const corpus_group_sptr& group,
+ unsigned indent,
+ std::ostream& out,
+ const bool annotate = false);
+
+bool ABG_DEPRECATED
+write_corpus_group(const corpus_group_sptr& group,
+ unsigned indent,
+ const string& path,
+ const bool annotate = false);
}// end namespace xml_writer
}// end namespace abigail
/// Serialize an ABI corpus group to a single native xml document.
/// The root note of the resulting XML document is 'abi-corpus-group'.
///
+/// @param ctxt the write context to use.
+///
/// @param group the corpus group to serialize.
///
/// @param indent the number of white space indentation to use.
///
-/// @param ctxt the write context to use.
-///
/// @return true upon successful completion, false otherwise.
bool
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- write_context& ctxt)
+write_corpus_group(write_context& ctxt,
+ const corpus_group_sptr& group,
+ unsigned indent)
{
if (!group)
return true;
}
+/// Serialize an ABI corpus group to a single native xml document.
+/// The root note of the resulting XML document is 'abi-corpus-group'.
+///
+/// @param group the corpus group to serialize.
+///
+/// @param indent the number of white space indentation to use.
+///
+/// @param ctxt the write context to use.
+///
+/// @deprecated use write_corpus_group(ctxt, corpus_group, indent)
+///
+/// @return true upon successful completion, false otherwise.
+bool ABG_DEPRECATED
+write_corpus_group(const corpus_group_sptr& group,
+ unsigned indent,
+ write_context& ctxt)
+
+{
+ return write_corpus_group(ctxt, group, indent);
+}
+
/// Serialize an ABI corpus group to a single native xml document.
/// The root note of the resulting XML document is 'abi-corpus-group'.
///
///
/// @param annotate whether ABIXML output should be annotated.
///
+/// @deprecated use write_corpus_group(ctxt, corpus_group, indent)
+///
/// @return true upon successful completion, false otherwise.
-bool
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- std::ostream& out,
- const bool annotate)
+bool ABG_DEPRECATED
+write_corpus_group(const corpus_group_sptr& group,
+ unsigned indent,
+ std::ostream& out,
+ const bool annotate)
{
if (!group)
write_context ctxt(group->get_environment(), out);
set_annotate(ctxt, annotate);
- return write_corpus_group(group, indent, ctxt);
+ return write_corpus_group(ctxt, group, indent);
}
/// Serialize an ABI corpus to a single native xml document. The root
<< opts.out_file_path << "'\n";
return 1;
}
- exit_code = !xml_writer::write_corpus_group(group, 0, of,
- opts.annotate);
+ const write_context_sptr& ctxt
+ = create_write_context(group->get_environment(), of);
+ set_annotate(*ctxt, opts.annotate);
+ exit_code = !write_corpus_group(*ctxt, group, 0);
}
else
- exit_code = !xml_writer::write_corpus_group(group, 0, cout,
- opts.annotate);
+ {
+ const write_context_sptr& ctxt
+ = create_write_context(group->get_environment(), cout);
+ set_annotate(*ctxt, opts.annotate);
+ exit_code = !write_corpus_group(*ctxt, group, 0);
+ }
}
return exit_code;