]> sourceware.org Git - libabigail.git/blob
200b5f7
[libabigail.git] /
1 // -*- Mode: C++ -*-
2 //
3 // Copyright (C) 2013-2019 Red Hat, Inc.
4 //
5 // This file is part of the GNU Application Binary Interface Generic
6 // Analysis and Instrumentation Library (libabigail). This library is
7 // free software; you can redistribute it and/or modify it under the
8 // terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option) any
10 // later version.
11
12 // This library is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details.
16
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this program; see the file COPYING-LGPLV3. If
19 // not, see <http://www.gnu.org/licenses/>.
20 //
21 // Author: Dodji Seketeli
22
23 /// @file
24 ///
25 /// This file contains the declarations of the entry points to
26 /// de-serialize an instance of @ref abigail::translation_unit to an
27 /// ABI Instrumentation file in libabigail native XML format.
28
29 #ifndef __ABG_WRITER_H__
30 #define __ABG_WRITER_H__
31
32 #include "abg-fwd.h"
33
34 namespace abigail
35 {
36 namespace xml_writer
37 {
38
39 using namespace abigail::ir;
40
41 class write_context;
42
43 /// A convenience typedef for a shared pointer to write_context.
44 typedef shared_ptr<write_context> write_context_sptr;
45
46 write_context_sptr
47 create_write_context(const environment *env,
48 ostream& output_stream);
49
50 void
51 set_show_locs(write_context& ctxt, bool flag);
52
53 void
54 set_annotate(write_context& ctxt, bool flag);
55
56
57 /// A convenience generic function to set common options (usually used
58 /// by Libabigail tools) from a generic options carrying-object, into
59 /// a given @ref write_context.
60 ///
61 /// @param ctxt the @ref the write_context to consider.
62 ///
63 /// @param opts the option-carrying object to set the options from.
64 /// It must contain data members named: annotate, and show_locs, at
65 /// very least.
66 template <typename OPTS>
67 void
68 set_common_options(write_context& ctxt, const OPTS& opts)
69 {
70 set_annotate(ctxt, opts.annotate);
71 set_show_locs(ctxt, opts.show_locs);
72 }
73
74 void
75 set_ostream(write_context& ctxt, ostream& os);
76
77 bool
78 write_translation_unit(write_context& ctxt,
79 const translation_unit& tu,
80 const unsigned indent);
81
82 bool ABG_DEPRECATED
83 write_translation_unit(const translation_unit& tu,
84 unsigned indent,
85 std::ostream& out,
86 const bool annotate = false);
87
88 bool ABG_DEPRECATED
89 write_translation_unit(const translation_unit& tu,
90 unsigned indent,
91 const string& path,
92 const bool annotate = false);
93
94 bool
95 write_corpus_to_archive(const corpus& corp,
96 const string& path,
97 const bool annotate = false);
98
99 bool
100 write_corpus_to_archive(const corpus& corp,
101 const bool annotate = false);
102
103 bool
104 write_corpus_to_archive(const corpus_sptr corp,
105 const bool annotate = false);
106
107 bool
108 write_corpus(write_context& ctxt, const corpus_sptr& corpus, unsigned indent);
109
110 bool ABG_DEPRECATED
111 write_corpus(const corpus_sptr& corpus, unsigned indent, write_context& ctxt);
112
113 bool ABG_DEPRECATED
114 write_corpus(const corpus_sptr corpus,
115 unsigned indent,
116 std::ostream& out,
117 const bool annotate = false);
118
119 bool ABG_DEPRECATED
120 write_corpus(const corpus_sptr corpus,
121 unsigned indent,
122 const string& path,
123 const bool annotate = false);
124
125 bool
126 write_corpus_group(write_context& ctx,
127 const corpus_group_sptr& group,
128 unsigned indent);
129
130 bool ABG_DEPRECATED
131 write_corpus_group(const corpus_group_sptr& group,
132 unsigned indent,
133 write_context& ctxt);
134
135 bool ABG_DEPRECATED
136 write_corpus_group(const corpus_group_sptr& group,
137 unsigned indent,
138 std::ostream& out,
139 const bool annotate = false);
140
141 bool ABG_DEPRECATED
142 write_corpus_group(const corpus_group_sptr& group,
143 unsigned indent,
144 const string& path,
145 const bool annotate = false);
146
147 }// end namespace xml_writer
148 }// end namespace abigail
149
150 #endif // __ABG_WRITER_H__
This page took 0.045335 seconds and 4 git commands to generate.