w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RfileFd.hpp
Go to the documentation of this file.
1// $Id: RfileFd.hpp 1180 2019-07-08 15:46:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2019- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-07-08 1180 1.1 add Open(fnam,flags,mode,emsg)
8// 2019-06-15 1163 1.0 Initial version
9// ---------------------------------------------------------------------------
10
11
16#ifndef included_Retro_RfileFd
17#define included_Retro_RfileFd 1
18
19#include <sys/types.h>
20#include <sys/stat.h>
21#include <fcntl.h>
22#include <unistd.h>
23
24#include "Rfd.hpp"
25#include "RerrMsg.hpp"
26
27
28namespace Retro {
29
30 class RfileFd : public Rfd {
31 public:
32 RfileFd();
33 explicit RfileFd(const char* cnam);
34
35 RfileFd(const RfileFd&) = delete; // noncopyable
36 RfileFd& operator=(const RfileFd&) = delete; // noncopyable
37
38 bool Open(const char* fname, int flags, RerrMsg& emsg);
39 bool Open(const char* fname, int flags, mode_t mode,
40 RerrMsg& emsg);
41 bool Stat(struct stat *sbuf, RerrMsg& emsg);
42 off_t Seek(off_t offset, int whence, RerrMsg& emsg);
43 bool Truncate(off_t length, RerrMsg& emsg);
44 ssize_t Read(void *buf, size_t count, RerrMsg& emsg);
45 bool WriteAll(const void *buf, size_t count, RerrMsg& emsg);
46};
47
48} // end namespace Retro
49
50//#include "RfileFd.ipp"
51
52#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rfd.hpp:25
FIXME_docs.
Definition: RfileFd.hpp:30
RfileFd()
FIXME_docs.
Definition: RfileFd.cpp:31
RfileFd(const RfileFd &)=delete
RfileFd & operator=(const RfileFd &)=delete
bool WriteAll(const void *buf, size_t count, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:119
ssize_t Read(void *buf, size_t count, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:107
bool Stat(struct stat *sbuf, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:71
off_t Seek(off_t offset, int whence, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:83
bool Open(const char *fname, int flags, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:45
bool Truncate(off_t length, RerrMsg &emsg)
FIXME_docs.
Definition: RfileFd.cpp:95
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47