x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
errors.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\interprocess\errors.hpp
Girar
Efecto
Propiedad
Historial
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // // Parts of this code are taken from boost::filesystem library // ////////////////////////////////////////////////////////////////////////////// // // Copyright � 2002 Beman Dawes // Copyright � 2001 Dietmar K�hl // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy // at http://www.boost.org/LICENSE_1_0.txt) // // See library home page at http://www.boost.org/libs/filesystem // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTERPROCESS_ERRORS_HPP #define BOOST_INTERPROCESS_ERRORS_HPP #if (defined _MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif #include
#include
#include
#include
#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) # include
#else # ifdef BOOST_HAS_UNISTD_H # include
//Errors # include
//strerror # else //ifdef BOOST_HAS_UNISTD_H # error Unknown platform # endif //ifdef BOOST_HAS_UNISTD_H #endif //#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) //!\file //!Describes the error numbering of interprocess classes namespace boost { namespace interprocess { /// @cond static inline int system_error_code() // artifact of POSIX and WINDOWS error reporting { #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) return winapi::get_last_error(); #else return errno; // GCC 3.1 won't accept ::errno #endif } #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) inline void fill_system_message(int sys_err_code, std::string &str) { void *lpMsgBuf; winapi::format_message( winapi::format_message_allocate_buffer | winapi::format_message_from_system | winapi::format_message_ignore_inserts, 0, sys_err_code, winapi::make_lang_id(winapi::lang_neutral, winapi::sublang_default), // Default language (char *) &lpMsgBuf, 0, 0 ); str += static_cast
(lpMsgBuf); winapi::local_free( lpMsgBuf ); // free the buffer while ( str.size() && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) str.erase( str.size()-1 ); } # else static inline void fill_system_message( int system_error, std::string &str) { str = std::strerror(system_error); } # endif /// @endcond enum error_code_t { 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, 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, lock_error, sem_error, mode_error, size_error, corrupted_error }; typedef int native_error_t; /// @cond struct ec_xlate { native_error_t sys_ec; error_code_t ec; }; static const ec_xlate ec_table[] = { #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) { /*ERROR_ACCESS_DENIED*/5L, security_error }, { /*ERROR_INVALID_ACCESS*/12L, security_error }, { /*ERROR_SHARING_VIOLATION*/32L, security_error }, { /*ERROR_LOCK_VIOLATION*/33L, security_error }, { /*ERROR_LOCKED*/212L, security_error }, { /*ERROR_NOACCESS*/998L, security_error }, { /*ERROR_WRITE_PROTECT*/19L, read_only_error }, { /*ERROR_NOT_READY*/21L, io_error }, { /*ERROR_SEEK*/25L, io_error }, { /*ERROR_READ_FAULT*/30L, io_error }, { /*ERROR_WRITE_FAULT*/29L, io_error }, { /*ERROR_CANTOPEN*/1011L, io_error }, { /*ERROR_CANTREAD*/1012L, io_error }, { /*ERROR_CANTWRITE*/1013L, io_error }, { /*ERROR_DIRECTORY*/267L, path_error }, { /*ERROR_INVALID_NAME*/123L, path_error }, { /*ERROR_FILE_NOT_FOUND*/2L, not_found_error }, { /*ERROR_PATH_NOT_FOUND*/3L, not_found_error }, { /*ERROR_DEV_NOT_EXIST*/55L, not_found_error }, { /*ERROR_DEVICE_IN_USE*/2404L, busy_error }, { /*ERROR_OPEN_FILES*/2401L, busy_error }, { /*ERROR_BUSY_DRIVE*/142L, busy_error }, { /*ERROR_BUSY*/170L, busy_error }, { /*ERROR_FILE_EXISTS*/80L, already_exists_error }, { /*ERROR_ALREADY_EXISTS*/183L, already_exists_error }, { /*ERROR_DIR_NOT_EMPTY*/145L, not_empty_error }, { /*ERROR_HANDLE_DISK_FULL*/39L, out_of_space_error }, { /*ERROR_DISK_FULL*/112L, out_of_space_error }, { /*ERROR_OUTOFMEMORY*/14L, out_of_memory_error }, { /*ERROR_NOT_ENOUGH_MEMORY*/8L, out_of_memory_error }, { /*ERROR_TOO_MANY_OPEN_FILES*/4L, out_of_resource_error } #else //#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) { EACCES, security_error }, { EROFS, read_only_error }, { EIO, io_error }, { ENAMETOOLONG, path_error }, { ENOENT, not_found_error }, // { ENOTDIR, not_directory_error }, { EAGAIN, busy_error }, { EBUSY, busy_error }, { ETXTBSY, busy_error }, { EEXIST, already_exists_error }, { ENOTEMPTY, not_empty_error }, { EISDIR, is_directory_error }, { ENOSPC, out_of_space_error }, { ENOMEM, out_of_memory_error }, { EMFILE, out_of_resource_error } #endif //#if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) }; static inline error_code_t lookup_error(native_error_t err) { const ec_xlate *cur = &ec_table[0], *end = cur + sizeof(ec_table)/sizeof(ec_xlate); for (;cur != end; ++cur ){ if ( err == cur->sys_ec ) return cur->ec; } return system_error; // general system error code } struct error_info { error_info(error_code_t ec = other_error ) : m_nat(0), m_ec(ec) {} error_info(native_error_t sys_err_code) : m_nat(sys_err_code), m_ec(lookup_error(sys_err_code)) {} error_info & operator =(error_code_t ec) { m_nat = 0; m_ec = ec; return *this; } error_info & operator =(native_error_t sys_err_code) { m_nat = sys_err_code; m_ec = lookup_error(sys_err_code); return *this; } native_error_t get_native_error()const { return m_nat; } error_code_t get_error_code()const { return m_ec; } private: native_error_t m_nat; error_code_t m_ec; }; /// @endcond } // namespace interprocess { } // namespace boost #include
#endif // BOOST_INTERPROCESS_ERRORS_HPP
errors.hpp
Dirección de la página
Dirección del archivo
Anterior
2/15
Siguiente
Descargar
( 7 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.