Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/qt_gui/src/lib/util/file.h @ 7612

Last change on this file since 7612 was 7612, checked in by bensch, 19 years ago

first function

File size: 1.1 KB
RevLine 
[7609]1/*!
2 * @file file.h
3 * @brief Definition of File Handler class
4 */
5
6#ifndef __FILE_H_
7#define __FILE_H_
8
9
10#include <string>
11
12class File
13{
14  public:
15  typedef enum
16  {
17    ReadOnly,
18    WriteOnly,
19    ReadWrite,
20    Append,
21  } OpenMode;
22
23public:
24  File();
25  File(const std::string& fileName);
26  File(const File& file);
27  ~File();
28
29  virtual bool open(OpenMode mode);
30  virtual bool close();
31  int handle();
32
33  bool exists();
[7611]34  bool isLink();      // only on UNIX
[7609]35  bool isFile();
[7611]36  bool isDirectory();
[7609]37  bool isReadeable();
38  bool isWriteable();
39  bool isExecutable();
40
41
42  bool copy(const File& destination);
43  bool rename(const File& destination);
44  bool touch();
45  bool remove();
46
47  static void relToAbs(std::string& fileName);
[7611]48  static void absToRel(std::string& fileName);
49  static const std::string& cwd();
[7609]50
51  private:
52    void homeDirCheck(std::string& fileName);
53
54  private:
[7611]55    int                 _handle;          //!< The FileHandle (if set).
[7612]56    std::string         _name;             //!< The Name of the File.
[7611]57
58    static std::string  _cwd;             //!< The currend Working directory.
[7609]59};
60
[7611]61#endif /* __FILE_H_ */
Note: See TracBrowser for help on using the repository browser.