Main Page
Namespaces
Classes
Files
File List
File Members
include
ecl
streams
shared_file_stream.hpp
Go to the documentation of this file.
1
8
/*****************************************************************************
9
** Ifdefs
10
*****************************************************************************/
11
12
#ifndef ECL_STREAMS_SHARED_FILE_STREAMS_HPP_
13
#define ECL_STREAMS_SHARED_FILE_STREAMS_HPP_
14
15
/*****************************************************************************
16
** Includes
17
*****************************************************************************/
18
19
#include <string>
20
#include <
ecl/config/macros.hpp
>
21
#include <
ecl/exceptions/standard_exception.hpp
>
22
#include <
ecl/devices/shared_file.hpp
>
23
#include "
text_stream.hpp
"
24
#include "
macros.hpp
"
25
26
/*****************************************************************************
27
** Namespaces
28
*****************************************************************************/
29
30
namespace
ecl
{
31
32
/*****************************************************************************
33
** Interfaces [SharedFileStream]
34
*****************************************************************************/
43
class
ecl_streams_PUBLIC
SharedFileStream
:
public
TextStream
<SharedFile> {
44
public
:
51
SharedFileStream
() {};
63
SharedFileStream
(
const
std::string &file_name,
const
WriteMode
&mode =
New
) ecl_throw_decl(
StandardException
) {
64
ecl_try
{
65
if
( !this->device().open(file_name, mode) ) {
66
error = this->device().error();
67
}
68
}
ecl_catch
(StandardException &e) {
69
ecl_throw
(StandardException(
LOC
,e));
70
}
71
}
72
virtual
~SharedFileStream
() {};
73
};
74
75
}
// namespace ecl
76
77
78
#endif
/* ECL_STREAMS_SHARED_FILE_STREAMS_HPP_ */
ecl
ecl::WriteMode
WriteMode
ecl_throw
#define ecl_throw(exception)
LOC
#define LOC
ecl::StandardException
ecl::SharedFileStream
Convenience class for SharedFile TextStream definitions.
Definition:
shared_file_stream.hpp:43
ecl_streams_PUBLIC
#define ecl_streams_PUBLIC
Definition:
macros.hpp:37
macros.hpp
shared_file.hpp
text_stream.hpp
Convenience header for various text streams.
ecl::TextStream
A text streaming interface.
Definition:
text_stream.hpp:94
ecl::SharedFileStream::SharedFileStream
SharedFileStream()
Default constructor, underlying device must be manually opened.
Definition:
shared_file_stream.hpp:51
ecl::SharedFileStream::SharedFileStream
SharedFileStream(const std::string &file_name, const WriteMode &mode=New) ecl_throw_decl(StandardException)
Convenience constructor for shared file text streams.
Definition:
shared_file_stream.hpp:63
ecl_catch
#define ecl_catch(exception)
ecl::SharedFileStream::~SharedFileStream
virtual ~SharedFileStream()
Definition:
shared_file_stream.hpp:72
ecl::New
New
standard_exception.hpp
ecl_try
#define ecl_try
ecl_streams
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:50