|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-12-12 16:12:21
At 02:14 PM 12/12/2002, Peter Dimov wrote:
>From: "Beman Dawes" <bdawes_at_[hidden]>
>> The exception class has been given additional functionality to provide
a
>> portable error code. Etc, etc.
>
>Q: have you considered using standard errno codes as the portable error
>code?
If I understand your question, this is now being done.
The filesystem_error class now has two member functions returning error
codes:
int native_error() const; // returns system specific code
// such as a POSIX or Windows error code
error_code error() const; // same on all systems; see below
enum error_code
{
no_error = 0,
system_error, // system generated error;
// if possible, is translated
// to one of the more specific errors below.
other_error, // library generated error
security_error, // includes access rights, permissions failures
read_only_error,
io_error,
path_error, // path format or a name in the path is invalid
not_found_error,
not_directory_error,
busy_error, // implies trying again might succeed
already_exists_error,
not_empty_error,
is_directory_error,
out_of_space_error,
out_of_memory_error,
out_of_resource_error
};
Is that what you meant by "standard errno code"?
The alternative I considered was to try to map the system specific code
into a POSIX errno code. However, the macros seemed messy for C++.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk