It's alive!! (The second one.)
[scummvm-innocent.git] / common / error.h
blob23305a5c2e4c9142497e854cde15d0f62ef20b50
1 /* ScummVM - Graphic Adventure Engine
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * $URL$
22 * $Id$
26 #ifndef COMMON_ERROR_H
27 #define COMMON_ERROR_H
29 namespace Common {
31 /**
32 * This file contains an enum with commonly used error codes.
37 /**
38 * Error codes which may be reported by plugins under various circumstances.
40 * @todo Clarify the names; add more codes, resp. verify all existing ones are acutally useful.
41 * Also, try to avoid overlap.
42 * @todo Maybe introduce a naming convention? E.g. k-NOUN/ACTION-CONDITION-Error, so
43 * kPathInvalidError would be correct, but these would not be: kInvalidPath,
44 * kPathInvalid, kPathIsInvalid, kInvalidPathError
46 enum Error {
47 kNoError = 0, //!< No error occured
48 kInvalidPathError, //!< Engine initialization: Invalid game path was passed
49 kNoGameDataFoundError, //!< Engine initialization: No game data was found in the specified location
50 kUnsupportedGameidError, //!< Engine initialization: Gameid not supported by this (Meta)Engine
53 kReadPermissionDenied, //!< Unable to read data due to missing read permission
54 kWritePermissionDenied, //!< Unable to write data due to missing write permission
56 // The following three overlap a bit with kInvalidPathError and each other. Which to keep?
57 kPathDoesNotExist, //!< The specified path does not exist
58 kPathNotDirectory, //!< The specified path does not point to a directory
59 kPathNotFile, //!< The specified path does not point to a file
61 kCreatingFileFailed,
62 kReadingFailed, //!< Failed creating a (savestate) file
63 kWritingFailed, //!< Failure to write data -- disk full?
65 kUnknownError //!< Catch-all error, used if no other error code matches
68 } // End of namespace Common
70 #endif //COMMON_ERROR_H