1 | /* Copyright © 2005-2007 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_NULL_H |
---|
20 | #define SBUILD_NULL_H |
---|
21 | |
---|
22 | #include <map> |
---|
23 | #include <stdexcept> |
---|
24 | #include <string> |
---|
25 | |
---|
26 | namespace sbuild |
---|
27 | { |
---|
28 | |
---|
29 | /** |
---|
30 | * Null. This class does nothing. It is used to represent an |
---|
31 | * absence of context or detail. |
---|
32 | */ |
---|
33 | class null |
---|
34 | { |
---|
35 | public: |
---|
36 | /** |
---|
37 | * Null output to an ostream. |
---|
38 | * |
---|
39 | * @param stream the stream to output to. |
---|
40 | * @param rhs the null to output. |
---|
41 | * @returns the stream. |
---|
42 | */ |
---|
43 | template <class charT, class traits> |
---|
44 | friend |
---|
45 | std::basic_ostream<charT,traits>& |
---|
46 | operator << (std::basic_ostream<charT,traits>& stream, |
---|
47 | null const& rhs) |
---|
48 | { |
---|
49 | return stream << null_output(); |
---|
50 | } |
---|
51 | |
---|
52 | private: |
---|
53 | /** |
---|
54 | * Get a string for output. |
---|
55 | * |
---|
56 | * @returns the word "unknown" (translated). |
---|
57 | */ |
---|
58 | static const char * |
---|
59 | null_output (); |
---|
60 | }; |
---|
61 | |
---|
62 | } |
---|
63 | |
---|
64 | #endif /* SBUILD_NULL_H */ |
---|
65 | |
---|
66 | /* |
---|
67 | * Local Variables: |
---|
68 | * mode:C++ |
---|
69 | * End: |
---|
70 | */ |
---|