roo_io
API Documentation for roo_io
Loading...
Searching...
No Matches
posix_file_input_stream.h
Go to the documentation of this file.
1
#include "
roo_io/fs/posix/config.h
"
2
3
#if ROO_IO_FS_SUPPORT_POSIX
4
5
#pragma once
6
7
#include <memory>
8
#include <stdio.h>
9
10
#include "
roo_io/core/multipass_input_stream.h
"
11
#include "
roo_io/fs/mount_impl.h
"
12
13
namespace
roo_io
{
14
15
class
PosixFileInputStream
:
public
MultipassInputStream {
16
public
:
17
PosixFileInputStream
(
Status
error
);
18
19
PosixFileInputStream
(std::shared_ptr<MountImpl> mount,
FILE
*
file
);
20
21
~PosixFileInputStream
();
22
23
size_t
read(
byte
*
buf
,
size_t
count
)
override
;
24
25
void
seek(
uint64_t
offset
)
override
;
26
27
void
skip(
uint64_t
count
)
override
;
28
29
uint64_t
position()
const override
{
return
(
::ftell
(
file_
)); }
30
31
uint64_t
size()
override
;
32
33
bool
isOpen()
const override
;
34
35
void
close()
override
;
36
37
Status
status()
const override
{
return
status_; }
38
39
private
:
40
std::shared_ptr<MountImpl> mount_;
41
FILE
*
file_
;
42
mutable
Status
status_;
43
};
44
45
}
// namespace roo_io
46
47
#endif
// ROO_IO_FS_SUPPORT_POSIX
config.h
mount_impl.h
multipass_input_stream.h
roo_io
Definition
byte.h:6
roo_io::basic_string_view
roo::basic_string_view< CharT, Traits > basic_string_view
Definition
string_view.h:8
roo_io::count
size_t count
Definition
compare.h:45
roo_io::Status
Status
Definition
status.h:7
temp_repos
roo_io
src
roo_io
fs
posix
posix_file_input_stream.h
Generated by
1.9.8