~ubuntu-branches/ubuntu/utopic/unrar-nonfree/utopic-updates

« back to all changes in this revision

Viewing changes to errhnd.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Chris Anderson
  • Date: 2004-07-02 01:53:47 UTC
  • Revision ID: james.westby@ubuntu.com-20040702015347-26ptn0errf3ew0u9
Tags: upstream-3.3.6
ImportĀ upstreamĀ versionĀ 3.3.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RAR_ERRHANDLER_
 
2
#define _RAR_ERRHANDLER_
 
3
 
 
4
#if (defined(GUI) || !defined(_WIN_32)) && !defined(SFX_MODULE) && !defined(_WIN_CE) || defined(RARDLL)
 
5
#define ALLOW_EXCEPTIONS
 
6
#endif
 
7
 
 
8
 
 
9
 
 
10
#define rarmalloc malloc
 
11
#define rarcalloc calloc
 
12
#define rarrealloc realloc
 
13
#define rarfree free
 
14
#define rarstrdup strdup
 
15
 
 
16
 
 
17
 
 
18
enum { SUCCESS,WARNING,FATAL_ERROR,CRC_ERROR,LOCK_ERROR,WRITE_ERROR,
 
19
       OPEN_ERROR,USER_ERROR,MEMORY_ERROR,CREATE_ERROR,USER_BREAK=255};
 
20
 
 
21
class ErrorHandler
 
22
{
 
23
  private:
 
24
    void ErrMsg(const char *ArcName,const char *fmt,...);
 
25
 
 
26
    int ExitCode;
 
27
    int ErrCount;
 
28
    bool EnableBreak;
 
29
    bool Silent;
 
30
    bool DoShutdown;
 
31
  public:
 
32
    ErrorHandler();
 
33
    void Clean();
 
34
    void MemoryError();
 
35
    void OpenError(const char *FileName);
 
36
    void CloseError(const char *FileName);
 
37
    void ReadError(const char *FileName);
 
38
    bool AskRepeatRead(const char *FileName);
 
39
    void WriteError(const char *ArcName,const char *FileName);
 
40
    void WriteErrorFAT(const char *FileName);
 
41
    bool AskRepeatWrite(const char *FileName);
 
42
    void SeekError(const char *FileName);
 
43
    void MemoryErrorMsg();
 
44
    void OpenErrorMsg(const char *FileName);
 
45
    void OpenErrorMsg(const char *ArcName,const char *FileName);
 
46
    void CreateErrorMsg(const char *FileName);
 
47
    void CreateErrorMsg(const char *ArcName,const char *FileName);
 
48
    void ReadErrorMsg(const char *ArcName,const char *FileName);
 
49
    void WriteErrorMsg(const char *ArcName,const char *FileName);
 
50
    void Exit(int ExitCode);
 
51
    void SetErrorCode(int Code);
 
52
    int GetErrorCode() {return(ExitCode);}
 
53
    int GetErrorCount() {return(ErrCount);}
 
54
    void SetSignalHandlers(bool Enable);
 
55
    void Throw(int Code);
 
56
    void SetSilent(bool Mode) {Silent=Mode;};
 
57
    void SetShutdown(bool Mode) {DoShutdown=Mode;};
 
58
    void SysErrMsg();
 
59
};
 
60
 
 
61
#endif