OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_FILES_C_LIB_FILE_FD_IMPL_H_ | |
6 #define SERVICES_FILES_C_LIB_FILE_FD_IMPL_H_ | |
7 | |
8 #include "files/public/c/lib/fd_impl.h" | |
9 #include "files/public/c/mojio_sys_types.h" | |
10 #include "files/public/interfaces/file.mojom.h" | |
11 #include "mojo/public/c/system/macros.h" | |
12 | |
13 namespace mojio { | |
14 | |
15 class FileFDImpl : public FDImpl { | |
16 public: | |
17 FileFDImpl(ErrnoImpl* errno_impl, mojo::files::FilePtr file); | |
18 ~FileFDImpl() override; | |
19 | |
20 // |FDImpl| implementation: | |
21 bool Close() override; | |
22 std::unique_ptr<FDImpl> Dup() override; | |
23 bool Ftruncate(mojio_off_t length) override; | |
24 mojio_off_t Lseek(mojio_off_t offset, int whence) override; | |
25 mojio_ssize_t Read(void* buf, size_t count) override; | |
26 mojio_ssize_t Write(const void* buf, size_t count) override; | |
27 bool Fstat(struct mojio_stat* buf) override; | |
28 | |
29 private: | |
30 mojo::files::FilePtr file_; | |
31 | |
32 MOJO_DISALLOW_COPY_AND_ASSIGN(FileFDImpl); | |
33 }; | |
34 | |
35 } // namespace mojio | |
36 | |
37 #endif // SERVICES_FILES_C_LIB_FILE_FD_IMPL_H_ | |
OLD | NEW |