glibmm: Glib::FileError Class Reference
Exception class for file-related errors. More...
#include <glibmm/fileutils.h>
Public Types | |
enum | Code { EXISTS, IS_DIRECTORY, ACCESS_DENIED, NAME_TOO_LONG, NO_SUCH_ENTITY, NOT_DIRECTORY, NO_SUCH_DEVICE, NOT_DEVICE, READONLY_FILESYSTEM, TEXT_FILE_BUSY, FAULTY_ADDRESS, SYMLINK_LOOP, NO_SPACE_LEFT, NOT_ENOUGH_MEMORY, TOO_MANY_OPEN_FILES, FILE_TABLE_OVERFLOW, BAD_FILE_DESCRIPTOR, INVALID_ARGUMENT, BROKEN_PIPE, TRYAGAIN, INTERRUPTED, IO_ERROR, NOT_OWNER, NOSYS, FAILED } |
Values corresponding to errno codes returned from file operations on UNIX. More... | |
Public Member Functions | |
FileError (Code error_code, const Glib::ustring& error_message) | |
FileError (GError* gobject) | |
Code | code () const |
Public Member Functions inherited from Glib::Error | |
Error () | |
Error (GQuark domain, int code, const Glib::ustring& message) | |
Error (GError* gobject, bool take_copy=false) | |
Error (const Error& other) | |
Error& | operator= (const Error& other) |
virtual | ~Error () throw () |
GQuark | domain () const |
int | code () const |
virtual Glib::ustring | what () const |
bool | matches (GQuark domain, int code) const |
GError* | gobj () |
const GError* | gobj () const |
Public Member Functions inherited from Glib::Exception | |
virtual | ~Exception ()=0 throw () |
Additional Inherited Members | |
Protected Attributes inherited from Glib::Error | |
GError* | gobject_ |
Detailed Description
Exception class for file-related errors.
Member Enumeration Documentation
Values corresponding to errno
codes returned from file operations on UNIX.
Unlike errno
codes, FileError::Code values are available on all systems, even Windows. The exact meaning of each code depends on what sort of file operation you were performing; the UNIX documentation gives more details. The following error code descriptions come from the GNU C Library manual, and are under the copyright of that manual.
It's not very portable to make detailed assumptions about exactly which errors will be returned from a given operation. Some errors don't occur on some systems, etc., sometimes there are subtle differences in when a system will report a given error, etc.
Enumerator | |
---|---|
EXISTS |
|
IS_DIRECTORY |
|
ACCESS_DENIED |
|
NAME_TOO_LONG |
|
NO_SUCH_ENTITY |
This is a "file doesn't exist" error for ordinary files that are referenced in contexts where they are expected to already exist. |
NOT_DIRECTORY |
|
NO_SUCH_DEVICE |
The system tried to use the device represented by a file you specified, and it couldn't find the device. This can mean that the device file was installed incorrectly, or that the physical device is missing or not correctly attached to the computer. |
NOT_DEVICE |
|
READONLY_FILESYSTEM |
|
TEXT_FILE_BUSY |
|
FAULTY_ADDRESS |
(Glib won't reliably return this, don't pass in pointers to bad memory.) |
SYMLINK_LOOP |
This often indicates a cycle of symbolic links. |
NO_SPACE_LEFT |
|
NOT_ENOUGH_MEMORY |
The system cannot allocate more virtual memory because its capacity is full. |
TOO_MANY_OPEN_FILES |
Duplicate descriptors do count toward this limit. |
FILE_TABLE_OVERFLOW |
|
BAD_FILE_DESCRIPTOR |
|
INVALID_ARGUMENT |
This is used to indicate various kinds of problems with passing the wrong argument to a library function. |
BROKEN_PIPE |
Every library function that returns this error code also generates a |
TRYAGAIN |
We used TRYAGAIN instead of TRY_AGAIN, because that is a defined as a macro by a Unix header. |
INTERRUPTED |
When this happens, you should try the call again. |
IO_ERROR |
I.e. the disk or other physical device hardware is returning errors. |
NOT_OWNER |
|
NOSYS | |
FAILED |
Does not correspond to a UNIX error code; this is the standard "failed for unspecified reason" error code present in all Glib::Error error code enumerations. Returned if no specific code applies. |
Constructor & Destructor Documentation
Glib::FileError::FileError | ( | Code | error_code, |
const Glib::ustring& | error_message | ||
) |
|
explicit |
Member Function Documentation
Code Glib::FileError::code | ( | ) | const |