~ubuntu-branches/ubuntu/wily/unrar-nonfree/wily-proposed

« back to all changes in this revision

Viewing changes to file.hpp

  • Committer: Package Import Robot
  • Author(s): Nick Andrik
  • Date: 2013-01-21 23:07:40 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20130121230740-yky1izwyj5x16wq1
Tags: 1:4.2.4-0.1
* Non-maintainer upload

* New upstream release (Closes: #687839)

* Add shared library binary and headers packages
  - Add entries into control file
  - Add libunrar0.{install,link,symbols} files
  - Add libunrar0-dev.install file
  - Patch missing binary object targets for library building
    (fix_missing_symbols)
  - Rename previous unrar-nonfree.{1,dirs,install,prerm,postint} file to
    unrar.* ones
  - Make sure libunrar.so is built (Closes: #485492, LP: #390263)
* Converted package to CDBS:
  - Simplified rules file
  - Added cdbs build-deps
* Added hardening support (Closes: #694611)
  - Updated compatibility version to 9
  - Added versioned dpkg-dev build-dep
* Updated copyright information:
  - Machine-readable format
  - Added missing files/licenses
* General maintentance:
  - Moved the homepage field in cortol file to the appropriate place
  - Bumped standards version to 3.9.4
  - Remove versioned conflict dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
};
25
25
 
26
26
 
 
27
enum FILE_MODE_FLAGS {
 
28
  // Request read only access to file. Default for Open.
 
29
  FMF_READ=0,
 
30
 
 
31
  // Request both read and write access to file. Default for Create.
 
32
  FMF_UPDATE=1,
 
33
 
 
34
  // Request write only access to file.
 
35
  FMF_WRITE=2,
 
36
 
 
37
  // Open files which are already opened for write by other programs.
 
38
  FMF_OPENSHARED=4,
 
39
 
 
40
  // Provide read access to created file for other programs.
 
41
  FMF_SHAREREAD=8,
 
42
 
 
43
  // Mode flags are not defined yet.
 
44
  FMF_UNDEFINED=256
 
45
};
 
46
 
 
47
 
27
48
class File
28
49
{
29
50
  private:
39
60
    bool AllowExceptions;
40
61
#ifdef _WIN_ALL
41
62
    bool NoSequentialRead;
 
63
    uint CreateMode;
42
64
#endif
43
65
  protected:
44
 
    bool OpenShared;
 
66
    bool OpenShared; // Set by 'Archive' class.
45
67
  public:
46
68
    char FileName[NM];
47
69
    wchar FileNameW[NM];
53
75
    File();
54
76
    virtual ~File();
55
77
    void operator = (File &SrcFile);
56
 
    bool Open(const char *Name,const wchar *NameW=NULL,bool OpenShared=false,bool Update=false);
 
78
    bool Open(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_READ);
57
79
    void TOpen(const char *Name,const wchar *NameW=NULL);
58
80
    bool WOpen(const char *Name,const wchar *NameW=NULL);
59
 
    bool Create(const char *Name,const wchar *NameW=NULL,bool ShareRead=true);
60
 
    void TCreate(const char *Name,const wchar *NameW=NULL,bool ShareRead=true);
61
 
    bool WCreate(const char *Name,const wchar *NameW=NULL,bool ShareRead=true);
 
81
    bool Create(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
 
82
    void TCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
 
83
    bool WCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
62
84
    bool Close();
63
85
    void Flush();
64
86
    bool Delete();