]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | // |
2 | // Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) | |
3 | // | |
4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | // | |
7 | // Official repository: https://github.com/boostorg/beast | |
8 | // | |
9 | ||
10 | #ifndef BOOST_BEAST_CORE_FILE_BASE_HPP | |
11 | #define BOOST_BEAST_CORE_FILE_BASE_HPP | |
12 | ||
13 | #include <boost/beast/core/detail/config.hpp> | |
14 | #include <boost/beast/core/string.hpp> | |
15 | ||
16 | namespace boost { | |
17 | namespace beast { | |
18 | ||
19 | /** File open modes | |
20 | ||
21 | These modes are used when opening files using | |
22 | instances of the @b File concept. | |
23 | ||
24 | @see file_stdio | |
25 | */ | |
26 | enum class file_mode | |
27 | { | |
28 | /// Random reading | |
29 | read, | |
30 | ||
31 | /// Sequential reading | |
32 | scan, | |
33 | ||
34 | /** Random writing to a new or truncated file | |
35 | ||
36 | @li If the file does not exist, it is created. | |
37 | ||
38 | @li If the file exists, it is truncated to | |
39 | zero size upon opening. | |
40 | */ | |
41 | write, | |
42 | ||
43 | /** Random writing to new file only | |
44 | ||
45 | If the file exists, an error is generated. | |
46 | */ | |
47 | write_new, | |
48 | ||
49 | /** Random writing to existing file | |
50 | ||
51 | If the file does not exist, an error is generated. | |
52 | */ | |
53 | write_existing, | |
54 | ||
55 | /** Appending to a new or truncated file | |
56 | ||
57 | The current file position shall be set to the end of | |
58 | the file prior to each write. | |
59 | ||
60 | @li If the file does not exist, it is created. | |
61 | ||
62 | @li If the file exists, it is truncated to | |
63 | zero size upon opening. | |
64 | */ | |
65 | append, | |
66 | ||
67 | /** Appending to a new file only | |
68 | ||
69 | The current file position shall be set to the end of | |
70 | the file prior to each write. | |
71 | ||
72 | If the file exists, an error is generated. | |
73 | */ | |
74 | append_new, | |
75 | ||
76 | /** Appending to an existing file | |
77 | ||
78 | The current file position shall be set to the end of | |
79 | the file prior to each write. | |
80 | ||
81 | If the file does not exist, an error is generated. | |
82 | */ | |
83 | append_existing | |
84 | }; | |
85 | ||
86 | } // beast | |
87 | } // boost | |
88 | ||
89 | #endif |