Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JAccessibleBinaryStream.hh
Go to the documentation of this file.
1#ifndef __JLANG__JACCESSIBLEBINARYSTREAM__
2#define __JLANG__JACCESSIBLEBINARYSTREAM__
3
4#include <fstream>
5#include <ios>
6
8
9
10/**
11 * \author mdejong
12 */
13
14namespace JLANG {}
15namespace JPP { using namespace JLANG; }
16
17namespace JLANG {
18
19 /**
20 * Accessible binary input stream.
21 *
22 * This class is a simple wrapper around the JAccessibleInputStream class.
23 * It re-implements the method open() of the JAccessible interface for binary I/O.
24 */
27 {
28 public:
29 /**
30 * Default constructor.
31 */
34
35
36 /**
37 * Constructor.
38 *
39 * \param file_name file name
40 */
41 JAccessibleBinaryInputStream(const char* file_name)
42 {
43 open(file_name);
44 }
45
46
47 /**
48 * Open file.
49 *
50 * \param file_name file name
51 */
52 virtual void open(const char* file_name) override
53 {
54 std::ifstream::open(file_name, std::ios::binary);
55 }
56 };
57
58
59 /**
60 * Accessible output stream.
61 *
62 * This class is a simple wrapper around the JAccessibleOutputStream class.
63 * It re-implements the method open() of the JAccessible interface for binary I/O.
64 */
67 {
68 public:
69 /**
70 * Default constructor.
71 */
74
75
76 /**
77 * Constructor.
78 *
79 * \param file_name file name
80 */
81 JAccessibleBinaryOutputStream(const char* file_name)
82 {
83 open(file_name);
84 }
85
86
87 /**
88 * Open file.
89 *
90 * \param file_name file name
91 */
92 virtual void open(const char* file_name) override
93 {
94 std::ofstream::open(file_name, std::ios::binary);
95 }
96 };
97}
98
99#endif
JAccessibleBinaryInputStream(const char *file_name)
Constructor.
virtual void open(const char *file_name) override
Open file.
JAccessibleBinaryOutputStream(const char *file_name)
Constructor.
virtual void open(const char *file_name) override
Open file.
Accessible input stream.
Accessible output stream.
Auxiliary classes and methods for language specific functionality.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).