24 #ifndef _TPIE_FILE_ACCESSOR_POSIX_H
25 #define _TPIE_FILE_ACCESSOR_POSIX_H
29 namespace file_accessor {
42 inline ~
posix() {close_i();}
44 inline void open_ro(
const std::string & path);
45 inline void open_wo(
const std::string & path);
46 inline bool try_open_rw(
const std::string & path);
47 inline void open_rw_new(
const std::string & path);
49 inline void read_i(
void * data, memory_size_type size);
50 inline void write_i(
const void * data, memory_size_type size);
51 inline void seek_i(stream_size_type offset);
52 inline stream_size_type file_size_i();
53 inline void close_i();
54 inline void truncate_i(stream_size_type bytes);
55 inline bool is_open()
const;
61 static inline void throw_errno(std::string path = std::string());
63 inline void set_cache_hint(
cache_hint cacheHint);
66 inline void _open(
const std::string & path,
int flags, mode_t mode);
67 inline void give_advice();
73 #include <tpie/file_accessor/posix.inl>
75 #endif //_TPIE_FILE_ACCESSOR_POSIX_H
static void throw_errno(std::string path=std::string())
Check the global errno variable and throw an exception that matches its value.
Reads and writes stream headers, user data and blocks from TPIE streams.
POSIX-style file accessor.