const translation_unit& tu,
const unsigned indent);
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
- unsigned indent,
- std::ostream& out,
- const bool annotate = false);
-
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
- unsigned indent,
- const string& path,
- const bool annotate = false);
-
bool
write_corpus_to_archive(const corpus& corp,
const string& path,
unsigned indent,
bool member_of_group = false);
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr& corpus, unsigned indent, write_context& ctxt);
-
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
- unsigned indent,
- std::ostream& out,
- const bool annotate = false);
-
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
- unsigned indent,
- const string& path,
- const bool annotate = false);
-
bool
write_corpus_group(write_context& ctx,
const corpus_group_sptr& group,
unsigned indent);
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- write_context& ctxt);
-
-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
return true;
}
-/// Serialize a translation unit to an output stream.
-///
-/// @param tu the translation unit to serialize.
-///
-/// @param indent how many indentation spaces to use during the
-/// serialization.
-///
-/// @param out the output stream to serialize the translation unit to.
-///
-/// @param annotate whether to annotate the output with debug information
-///
-/// @deprecated use write_translation_unit(ctct, tu, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
- unsigned indent,
- std::ostream& out,
- const bool annotate)
-{
- write_context ctxt(tu.get_environment(), out);
- set_annotate(ctxt, annotate);
- return write_translation_unit(ctxt, tu, indent);
-}
-
-/// Serialize a translation unit to a file.
-///
-/// @param tu the translation unit to serialize.
-///
-/// @param indent how many indentation spaces to use during the
-/// serialization.
-///
-/// @param path the file to serialize the translation unit to.
-///
-/// @param annotate whether to annotate the output with debug information
-///
-/// @deprecated use write_translation_unit(ctct, tu, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
- unsigned indent,
- const string& path,
- const bool annotate)
-{
- bool result = true;
-
- try
- {
- ofstream of(path.c_str(), std::ios_base::trunc);
- if (!of.is_open())
- {
- cerr << "failed to access " << path << "\n";
- return false;
- }
-
- write_context ctxt(tu.get_environment(), of);
- set_annotate(ctxt, annotate);
- if (!write_translation_unit(ctxt, tu, indent))
- {
- cerr << "failed to access " << path << "\n";
- result = false;
- }
-
- of.close();
- }
- catch(...)
- {
- cerr << "failed to write to " << path << "\n";
- result = false;
- }
-
- return result;
-}
-
-
/// Serialize a pointer to an instance of basic type declaration, into
/// an output stream.
///
return true;
}
-/// Serialize an ABI corpus to a single native xml document. The root
-/// node of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param ctxt the write context to use.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr& corpus, unsigned indent, write_context& ctxt)
-{
- return write_corpus(ctxt, corpus, indent);
-}
-
-/// Serialize an ABI corpus to a single native xml document. The root
-/// node of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param out the output stream to serialize the ABI corpus to.
-///
-/// @param annotate whether ABIXML output should be annotated.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
- unsigned indent,
- std::ostream& out,
- const bool annotate)
-{
- if (!corpus)
- return false;
-
- write_context ctxt(corpus->get_environment(), out);
- set_annotate(ctxt, annotate);
-
- return write_corpus(ctxt, corpus, indent);
-}
-
/// Serialize an ABI corpus group to a single native xml document.
/// The root note of the resulting XML document is 'abi-corpus-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 group the corpus group to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param out the output stream to serialize the ABI corpus to.
-///
-/// @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 ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
- unsigned indent,
- std::ostream& out,
- const bool annotate)
-
-{
- if (!group)
- return false;
-
- write_context ctxt(group->get_environment(), out);
- set_annotate(ctxt, annotate);
-
- return write_corpus_group(ctxt, group, indent);
-}
-
-/// Serialize an ABI corpus to a single native xml document. The root
-/// note of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param path the output file to serialize the ABI corpus to.
-///
-/// @param annotate whether ABIXML output should be annotated.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
- unsigned indent,
- const string& path,
- const bool annotate)
-{
- bool result = true;
-
- try
- {
- ofstream of(path.c_str(), std::ios_base::trunc);
- if (!of.is_open())
- {
- cerr << "failed to access " << path << "\n";
- return false;
- }
-
- const write_context_sptr& ctxt
- = create_write_context(corpus->get_environment(), of);
- ctxt->set_annotate(annotate);
- if (!write_corpus(*ctxt, corpus, indent))
- {
- cerr << "failed to access " << path << "\n";
- result = false;
- }
-
- of.close();
- }
- catch(...)
- {
- cerr << "failed to write to " << path << "\n";
- result = false;
- }
-
- return result;
-}
-
} //end namespace xml_writer
// <Debugging routines>