/* * This file is a part of CMSLU -- Content Management System like Unix * and is not publicly distributed * * Copyright (c) 2008-2009, Tomasz Sowa * All rights reserved. * */ #ifndef headerfilecmslucoreerror #define headerfilecmslucoreerror #include #include "log.h" class Error { public: enum Code { ok = 0, incorrect_path, db_fatal_error_during_connecting, db_incorrect_query, db_incorrent_result_status, db_no_column, db_incorrect_login, db_more_than_one_login, db_err_currval, no_postvar, incorrect_dir, cant_change_user, cant_change_group, cant_change_privileges, permission_denied, no_root_dir, no_function, no_item, unknown_param, mount_unknown, unknown_filesystem, no_mountpoint, mount_no_param, no_thread, empty, spam, incorrect_rebus, no_boundary, broken_input, input_too_large, cant_create_file, no_ticket, unknown = 1000 }; Error(); Error(Code c); Error(int i); Error(const Error & e); Error & operator=(Code c); Error & operator=(const Error & e); operator int() const; bool operator==(Code c) const; bool operator!=(Code c) const; bool operator==(const Error & e) const; bool operator!=(const Error & e) const; friend std::ostream & operator<<(std::ostream & out, const Error & e); friend Log & operator<<(Log & out, const Error & e); private: Code code; }; #endif