roo_io
API Documentation for roo_io
Loading...
Searching...
No Matches
status.h
Go to the documentation of this file.
1#pragma once
2
3#include "roo_logging.h"
4
5namespace roo_io {
6
7enum Status {
8 kOk = 0,
16
18
19 // A write operation was requested, but the filesystem is mounted as
20 // read-only.
22
23 // Requested file, directory, or its path component, does not exist.
25
26 // A create or rename operation was requested, while the destination already
27 // exists and it is a file.
29
30 // A create or rename operation was requested, while the destination already
31 // exists and it is a directory.
33
34 // A component used as a directory in the path is not, in fact, a directory.
36
37 // An operation was requested that expects an existing file, while the
38 // destination exists but it is not a file.
40
41 // The 'rmdir' operation was requested, while the target directory exists but
42 // it is not empty.
44
45 // The specified path is syntactically invalid.
47
48 // Out-of-memory error has occurred.
50
51 // The limit of open files has been reached.
53
54 // The capacity of the target device has been exceeded.
56
57 // Unexpected general I/O error has ocurred.
59
60 // Permissions are insufficient.
62
63 // Mount failed because the media is absent.
65
66 // Remote connection has been abruptly terminated.
68
69 // Write failed because the receiver has closed the connection.
71};
72
73const char* StatusAsString(Status status);
74
75inline roo_logging::Stream& operator<<(roo_logging::Stream& s, Status status) {
76 s << StatusAsString(status);
77 return s;
78}
79
80} // namespace roo_io
Definition byte.h:6
roo::basic_string_view< CharT, Traits > basic_string_view
Definition string_view.h:8
roo_logging::Stream & operator<<(roo_logging::Stream &s, const MacAddress &addr)
Status
Definition status.h:7
@ kNoSpaceLeftOnDevice
Definition status.h:55
@ kGenericMountError
Definition status.h:17
@ kUnknownIOError
Definition status.h:58
@ kReadOnlyFilesystem
Definition status.h:21
@ kConnectionError
Definition status.h:67
@ kInvalidPath
Definition status.h:46
@ kAccessDenied
Definition status.h:61
@ kOutOfMemory
Definition status.h:49
@ kNoMedia
Definition status.h:64
@ kOpenError
Definition status.h:12
@ kBrokenPipe
Definition status.h:70
@ kFileExists
Definition status.h:28
@ kNotFile
Definition status.h:39
@ kOk
Definition status.h:8
@ kTooManyFilesOpen
Definition status.h:52
@ kSeekError
Definition status.h:14
@ kDirectoryExists
Definition status.h:32
@ kNotDirectory
Definition status.h:35
@ kClosed
Definition status.h:10
@ kNotMounted
Definition status.h:11
@ kNotFound
Definition status.h:24
@ kDirectoryNotEmpty
Definition status.h:43
@ kReadError
Definition status.h:13
@ kWriteError
Definition status.h:15
@ kEndOfStream
Definition status.h:9
const char * StatusAsString(Status status)
Definition status.cpp:5