IBR-DTNSuite  0.12
FATFile.h
Go to the documentation of this file.
1 /*
2  * FATFile.h
3  *
4  * Copyright (C) 2013 IBR, TU Braunschweig
5  *
6  * Written-by: David Goltzsche <goltzsch@ibr.cs.tu-bs.de>
7  * Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Created on: Sep 23, 2013
22  *
23  * This class provides the same methods as ibrcommon::File, but for a file
24  * on a FAT image.
25  * A few methods are not implemented, because not needed;
26  */
27 
28 #ifndef FATFILE_H_
29 #define FATFILE_H_
30 
31 #include "config.h"
32 #include <ibrcommon/data/File.h>
33 #include <list>
34 
35 namespace io
36 {
37  class FatImageReader;
38 
39  class FATFile : public ibrcommon::File
40  {
41  public:
42  FATFile(const FatImageReader &reader);
43  FATFile(const FatImageReader &reader, const std::string &file_path);
44  virtual ~FATFile();
45 
46  int getFiles(std::list<FATFile> &files) const;
47 
48  virtual int remove(bool recursive);
49 
50  FATFile get(const std::string &filename) const;
51  FATFile getParent() const;
52 
53  virtual bool exists() const;
54  virtual void update();
55  virtual size_t size() const;
56  virtual time_t lastaccess() const;
57  virtual time_t lastmodify() const;
58  virtual time_t laststatchange() const;
59 
60  const FatImageReader &getReader() const;
61 
62  private:
63  const FatImageReader &_reader;
64  };
65 }
66 #endif /* FATFILE_H_ */