AsyncFw 1.2
Async Framework is c++ runtime with timers, poll notifiers, sockets, coroutines, etc.
 
Loading...
Searching...
No Matches
File.h
1/*
2Copyright (c) 2026 Alexandr Kuzmuk
3
4This file is part of the AsyncFw project. Licensed under the MIT License.
5See {Link: LICENSE file https://mit-license.org} in the project root for full license information.
6*/
7
8#pragma once
9
10#include <ios>
11#include <cstdint>
12
13namespace AsyncFw {
14class DataArray;
16class File {
17 struct Private;
18
19public:
20 File(const std::string & = {});
21 ~File();
22 bool open(const std::string &, std::ios::openmode = std::ios::binary | std::ios::in);
23 bool open(std::ios::openmode = std::ios::binary | std::ios::in);
24 void close();
25 void flush();
26 void remove();
27 std::size_t size();
28 bool exists();
29 DataArray read(std::size_t = SIZE_MAX);
30 std::streamsize write(const DataArray &);
31 std::streamsize read(char *, std::streamsize);
32 std::streamsize write(const char *, std::streamsize);
33 std::string readLine();
34 bool fail();
35
36 std::fstream &fstream();
37
38private:
39 File(File &) = delete;
40 File &operator=(File &) = delete;
41 Private *private_;
42};
43} // namespace AsyncFw
The DataArray class.
Definition DataArray.h:20