CMS 3D CMS Logo

binary_ifstream.h
Go to the documentation of this file.
1 #ifndef binary_ifstream_H
2 #define binary_ifstream_H
3 
4 #include <string>
5 #include <cstdio>
7 
9 public:
10  explicit binary_ifstream(const char* name);
11  explicit binary_ifstream(const std::string& name);
12 
14 
16  binary_ifstream& operator>>(unsigned char& n);
17 
18  binary_ifstream& operator>>(short& n);
19  binary_ifstream& operator>>(unsigned short& n);
20 
21  binary_ifstream& operator>>(int& n);
22  binary_ifstream& operator>>(unsigned int& n);
23 
24  binary_ifstream& operator>>(long& n);
25  binary_ifstream& operator>>(unsigned long& n);
26 
27  binary_ifstream& operator>>(float& n);
28  binary_ifstream& operator>>(double& n);
29 
30  binary_ifstream& operator>>(bool& n);
32 
33  void close();
34 
36  bool good() const;
37  bool eof() const;
38  bool fail() const;
39  bool bad() const;
40  bool operator!() const;
41  operator bool() const;
42 
43 private:
44  FILE* file_;
45 
46  void init(const char* name);
47 };
48 
49 #endif
bool bad() const
bool good() const
stream state checking
bool eof() const
bool operator!() const
binary_ifstream(const char *name)
binary_ifstream & operator>>(char &n)
void init(const char *name)
bool fail() const