2008-12-10 05:42:49 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef headerfileerror
|
|
|
|
#define headerfileerror
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#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,
|
2008-12-30 02:05:03 +01:00
|
|
|
db_no_item, // !! zamienic na no_item
|
2008-12-10 05:42:49 +01:00
|
|
|
db_incorrect_login,
|
|
|
|
db_more_than_one_login,
|
|
|
|
db_err_currval,
|
2008-12-30 02:05:03 +01:00
|
|
|
no_postvar,
|
2008-12-10 05:42:49 +01:00
|
|
|
incorrect_dir,
|
2008-12-21 22:17:09 +01:00
|
|
|
cant_change_user,
|
|
|
|
cant_change_group,
|
|
|
|
cant_change_privileges,
|
2008-12-30 02:05:03 +01:00
|
|
|
permision_denied, // !! permission_denied (dwa ss)
|
|
|
|
no_root_dir,
|
|
|
|
no_function, // !! zamienic na no_function
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
item_required, // !! zamienic na no_item (i usunac db_no_item)
|
2009-02-06 14:12:03 +01:00
|
|
|
unknown_param,
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
mount_unknown,
|
|
|
|
no_mountpoint,
|
2008-12-10 05:42:49 +01:00
|
|
|
unknown = 1000
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Error();
|
|
|
|
Error(Code c);
|
|
|
|
Error(int i);
|
2008-12-21 22:17:09 +01:00
|
|
|
Error(const Error & e);
|
2008-12-10 05:42:49 +01:00
|
|
|
Error & operator=(Code c);
|
2008-12-21 22:17:09 +01:00
|
|
|
Error & operator=(const Error & e);
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
operator int() const;
|
|
|
|
|
|
|
|
bool operator==(Code c) const;
|
|
|
|
bool operator!=(Code c) const;
|
2008-12-30 02:05:03 +01:00
|
|
|
bool operator==(const Error & e) const;
|
|
|
|
bool operator!=(const Error & e) const;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
friend std::ostream & operator<<(std::ostream & out, const Error & e);
|
|
|
|
friend Log & operator<<(Log & out, const Error & e);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Code code;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|