CTR Pia  4.11.3
Game Communication Engine
common_EmptyStream.h
1 /*---------------------------------------------------------------------------*
2  Project: Pia
3  File: common_EmptyStream.h
4 
5  Copyright Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 
15 #pragma once
16 
17 #include <pia/common/common_definitions.h>
18 
19 
20 namespace nn
21 {
22 namespace pia
23 {
24 namespace common
25 {
26 
27 /*!
28 @cond PRIVATE
29 @brief This class uses the same interface as <tt>StringStream</tt>. However, it performs no substantial operations. It is intended to prevent warnings.
30 */
31 class EmptyStream
32 {
33 public:
34  EmptyStream(void)
35  {
36  }
37  EmptyStream(u64)
38  {
39  } // Dummy constructor used only for receiving flags.
40  ~EmptyStream(void)
41  {
42  }
43 
44  u32 GetLength() const
45  {
46  return 0;
47  }
48  u32 GetSize() const
49  {
50  return 0;
51  }
52  const char* CStr() const
53  {
54  return NULL;
55  }
56 
57  EmptyStream& operator<<(const char*)
58  {
59  return *this;
60  }
61  EmptyStream& operator<<(const void*)
62  {
63  return *this;
64  }
65  EmptyStream& operator<<(bool)
66  {
67  return *this;
68  }
69  EmptyStream& operator<<(f64)
70  {
71  return *this;
72  }
73  EmptyStream& operator<<(f32)
74  {
75  return *this;
76  }
77 
78  EmptyStream& operator<<(u8)
79  {
80  return *this;
81  }
82  EmptyStream& operator<<(s8)
83  {
84  return *this;
85  }
86  EmptyStream& operator<<(u16)
87  {
88  return *this;
89  }
90  EmptyStream& operator<<(s16)
91  {
92  return *this;
93  }
94  EmptyStream& operator<<(u32)
95  {
96  return *this;
97  }
98  EmptyStream& operator<<(s32)
99  {
100  return *this;
101  }
102 
103  EmptyStream& operator<<(u64)
104  {
105  return *this;
106  }
107  EmptyStream& operator<<(s64)
108  {
109  return *this;
110  }
111 
112  EmptyStream& operator<<(const EmptyStream&)
113  {
114  return *this;
115  }
116 
117  // Manipulators.
118  EmptyStream& operator<<(EmptyStream& (*)(EmptyStream&))
119  {
120  return *this;
121  }
122 
123  EmptyStream& Manip_hex()
124  {
125  return *this;
126  }
127  EmptyStream& Manip_dec()
128  {
129  return *this;
130  }
131  EmptyStream& Manip_zerohex()
132  {
133  return *this;
134  }
135 
136 
137  EmptyStream& Manip_showbase()
138  {
139  return *this;
140  }
141  EmptyStream& Manip_noshowbase()
142  {
143  return *this;
144  }
145  EmptyStream& Manip_boolalpha()
146  {
147  return *this;
148  }
149  EmptyStream& Manip_noboolalpha()
150  {
151  return *this;
152  }
153 
154  const char& operator[](u32) const; // Not implemented.
155 
156 private:
157  EmptyStream(const EmptyStream&);
158  EmptyStream& operator=(const EmptyStream&);
159 };
160 
161 
162 inline EmptyStream& hex(EmptyStream& s)
163 {
164  return s;
165 }
166 inline EmptyStream& dec(EmptyStream& s)
167 {
168  return s;
169 }
170 inline EmptyStream& endl(EmptyStream& s)
171 {
172  return s;
173 }
174 inline EmptyStream& showbase(EmptyStream& s)
175 {
176  return s;
177 }
178 inline EmptyStream& noshowbase(EmptyStream& s)
179 {
180  return s;
181 }
182 inline EmptyStream& boolalpha(EmptyStream& s)
183 {
184  return s;
185 }
186 inline EmptyStream& noboolalpha(EmptyStream& s)
187 {
188  return s;
189 }
190 
191 inline EmptyStream& zerohex(EmptyStream& s)
192 {
193  return s;
194 }
195 
196 //! @endcond
197 }
198 }
199 } // end of namespace nn::pia::common
Definition: assert.h:115