12 #ifndef ECL_DEVICES_OFILE_POS_HPP_ 13 #define ECL_DEVICES_OFILE_POS_HPP_ 19 #include <ecl/config/ecl.hpp> 20 #if defined(ECL_IS_POSIX) 26 #include <sys/types.h> 122 OFile(
const std::string &file_name,
const WriteMode &mode =
New) ecl_throw_decl(StandardException);
137 virtual
bool open() {
return ( file != NULL ) ?
true :
false; }
166 virtual bool open(
const std::string &file_name,
const WriteMode &mode =
New) ecl_throw_decl(StandardException);
185 virtual
bool close() ecl_throw_decl(StandardException);
194 virtual const std::
string& filename()
const {
return name; }
273 template <
typename ByteArray>
286 virtual bool flush() ecl_debug_throw_decl(StandardException);
291 const Error& error()
const {
return error_handler; }
307 template <
typename ByteArray>
316 size_t written = fwrite(&byte_array[0],byte_array.size(),1,file);
323 return byte_array.size()*written;
337 class is_sink<OFile> :
public True {};
Embedded control libraries.
WriteMode
Write mode for devices.
Array< char, 3 > ByteArray
#define ecl_compile_time_concept_check(Model)
#define ecl_debug_throw_decl(exception)
#define ecl_debug_throw(exception)
Defines exception handlers for posix devices.
Opens a new object (deletes existing objects).