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,2022 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);
45 
47  FXFile(const FXString& filename,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
48 
50  virtual FXbool open(const FXString& filename,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
51 
53  virtual FXbool isSerial() const;
54 
56  virtual FXlong position() const;
57 
59  virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
60 
62  virtual FXlong truncate(FXlong sz);
63 
65  virtual FXbool flush();
66 
68  virtual FXint eof();
69 
71  virtual FXlong size();
72 
74  static FXbool create(const FXString& file,FXuint perm=FXIO::AllReadWrite);
75 
77  static FXbool link(const FXString& srcfile,const FXString& dstfile);
78 
80  static FXString symlink(const FXString& file);
81 
83  static FXbool symlink(const FXString& srcfile,const FXString& dstfile);
84 
86  static FXbool identical(const FXString& file1,const FXString& file2);
87 
89  static FXbool copy(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
90 
92  static FXbool copyFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
93 
94 
96  static FXbool move(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
97 
99  static FXbool moveFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
100 
101 
103  static FXbool remove(const FXString& file);
104 
106  static FXbool removeFiles(const FXString& path,FXbool recursive=false);
107 
108 
110  static FXbool concat(const FXString& srcfile1,const FXString& srcfile2,const FXString& dstfile,FXbool overwrite=false);
111  };
112 
113 }
114 
115 #endif
Execute permission for all.
Definition: FXIO.h:92
FXFile()
Construct file.
Definition: FXFile.h:41
Child process can inherit handle.
Definition: FXIO.h:53
Definition: FX4Splitter.h:28
FXIODevice manipulates a handle to operating system i/o device, such as pipes, sockets, or files.
Definition: FXIODevice.h:35
Low level file access.
Definition: FXFile.h:34
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp