Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXFile.h
1 /********************************************************************************
2 * *
3 * F i l e C l a s s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXFILE_H
22 #define FXFILE_H
23 
24 #ifndef FXIODEVICE_H
25 #include "FXIODevice.h"
26 #endif
27 
28 namespace FX {
29 
30 
34 class FXAPI FXFile : public FXIODevice {
35 private:
36  FXFile(const FXFile&);
37  FXFile &operator=(const FXFile&);
38 public:
39 
41  FXFile(){ }
42 
44  FXFile(FXInputHandle h,FXuint m=FXIO::Reading);
45 
47  FXFile(const FXString& file,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
48 
50  virtual FXbool open(const FXString& file,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
51 
53  virtual FXbool open(FXInputHandle h,FXuint m=FXIO::Reading);
54 
56  virtual FXbool isSerial() const;
57 
59  virtual FXlong position() const;
60 
62  virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
63 
65  virtual FXlong truncate(FXlong sz);
66 
68  virtual FXbool flush();
69 
71  virtual FXint eof();
72 
74  virtual FXlong size();
75 
77  static FXbool create(const FXString& file,FXuint perm=FXIO::AllReadWrite);
78 
80  static FXbool link(const FXString& srcfile,const FXString& dstfile);
81 
83  static FXString symlink(const FXString& file);
84 
86  static FXbool symlink(const FXString& srcfile,const FXString& dstfile);
87 
89  static FXbool identical(const FXString& file1,const FXString& file2);
90 
92  static FXbool copy(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
93 
95  static FXbool copyFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
96 
97 
99  static FXbool move(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
100 
102  static FXbool moveFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
103 
104 
106  static FXbool remove(const FXString& file);
107 
109  static FXbool removeFiles(const FXString& path,FXbool recursive=false);
110 
111 
113  static FXbool concat(const FXString& srcfile1,const FXString& srcfile2,const FXString& dstfile,FXbool overwrite=false);
114  };
115 
116 }
117 
118 #endif

Copyright © 1997-2016 Jeroen van der Zijp