Michele De Stefano's C++ Utilities
cfile_stream.hpp
Go to the documentation of this file.
1 // mds_utils/file_utils/cfile_stream.hpp
2 //
3 // Copyright (c) 2009 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
7 #ifndef CFILE_STREAM_HPP_INCLUDED
8 #define CFILE_STREAM_HPP_INCLUDED
9 
40 #include <mds_utils/file_utils/detail/cfile_device_base.hpp>
47 namespace mds_utils {
48 
55  namespace file_utils {
56 
57 
68 struct cFile_Source : detail::cFile_Device_base<cFile_Source> {
69 
70  typedef detail::cFile_Device_base<cFile_Source>::char_type char_type;
71  typedef detail::cFile_Device_base<cFile_Source>::category category;
72 
75 
86  cFile_Source(FILE *ptr) : detail::cFile_Device_base<cFile_Source>(ptr) {}
87 
88  DEF_READ
89 };
90 
91 
102 struct cFile_Sink : detail::cFile_Device_base<cFile_Sink> {
103 
104  typedef detail::cFile_Device_base<cFile_Sink>::char_type char_type;
105  typedef detail::cFile_Device_base<cFile_Sink>::category category;
106 
109 
120  cFile_Sink(FILE *ptr) : detail::cFile_Device_base<cFile_Sink>(ptr) {}
121 
122  DEF_WRITE
123  DEF_FLUSH
124 };
125 
126 
135 struct cFile_Device : detail::cFile_Device_base<cFile_Device> {
136 
137  typedef detail::cFile_Device_base<cFile_Device>::char_type char_type;
138  typedef detail::cFile_Device_base<cFile_Device>::category category;
139 
142 
153  cFile_Device(FILE *ptr) : detail::cFile_Device_base<cFile_Device>(ptr) {}
154 
155  DEF_READ
156  DEF_WRITE
157  DEF_FLUSH
158 };
159 
160 
161 
162  } // namespace file_utils
163 } // namespace mds_utils
164 
165 #endif
Source device for FILE* pointers.
Sink device for FILE* pointers.
cFile_Device(FILE *ptr)
Constructor.
cFile_Source(FILE *ptr)
Constructor.
detail::cFile_Device_base< cFile_Source >::category category
Category.
detail::cFile_Device_base< cFile_Device >::category category
Category.
Main namespace of all Michele De Stefano&#39;s C++ utilities.
Definition: endian.hpp:30
cFile_Sink()
Default constructor.
detail::cFile_Device_base< cFile_Device >::char_type char_type
Character type.
detail::cFile_Device_base< cFile_Source >::char_type char_type
Character type.
Device for FILE* pointers.
cFile_Source()
Default constructor.
cFile_Device()
Default constructor.
detail::cFile_Device_base< cFile_Sink >::category category
Category.
detail::cFile_Device_base< cFile_Sink >::char_type char_type
Character type.
cFile_Sink(FILE *ptr)
Constructor.