sbuild  1.7.2
keyfile-writer.h
1 /* Copyright © 2005-2013 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_KEYFILE_WRITER_H
20 #define SBUILD_KEYFILE_WRITER_H
21 
22 #include <ostream>
23 
24 #include <sbuild/keyfile.h>
25 
26 namespace sbuild
27 {
28 
33  {
34  public:
37 
44 
52  const std::string& file);
53 
61  std::ostream& stream);
62 
64  virtual ~keyfile_writer();
65 
72  virtual void
73  write_stream(std::ostream& stream) const;
74 
75  protected:
77  const keyfile& store;
78 
90  static void
91  print_comment (const keyfile::comment_type& comment,
92  std::ostream& stream);
93 
101  friend
102  std::ostream&
103  operator << (std::ostream& stream,
104  const keyfile_writer& kp)
105  {
106  kp.write_stream(stream);
107  return stream;
108  }
109  };
110 
111 }
112 
113 #endif /* SBUILD_KEYFILE_WRITER_H */
114 
115 /*
116  * Local Variables:
117  * mode:C++
118  * End:
119  */
virtual ~keyfile_writer()
The destructor.
Definition: keyfile-writer.cc:55
Debian source builder components.
Definition: ctty.cc:31
keyfile::error error
Exception type.
Definition: keyfile-writer.h:36
Keyfile writer.
Definition: keyfile-writer.h:32
keyfile_writer(const keyfile &store)
The constructor.
Definition: keyfile-writer.cc:28
friend std::ostream & operator<<(std::ostream &stream, const keyfile_writer &kp)
keyfile output to an ostream.
Definition: keyfile-writer.h:103
static void print_comment(const keyfile::comment_type &comment, std::ostream &stream)
Print a comment to a stream.
Definition: keyfile-writer.cc:91
std::string comment_type
Comment.
Definition: keyfile.h:98
Parse error.
Definition: parse-error.h:34
const keyfile & store
The keyfile to operate with.
Definition: keyfile-writer.h:77
Configuration file parser.
Definition: keyfile.h:46
virtual void write_stream(std::ostream &stream) const
Write keyfile to a stream.
Definition: keyfile-writer.cc:59