embkernel
 All Classes Functions Variables Typedefs Groups Pages
FsFile.hpp
1 //------------------------------------------------------------------------------
2 //This file is part of embKernel.
3 //See license.txt for the full license governing this code.
4 //------------------------------------------------------------------------------
5 
6 #ifndef FS_FILE_HPP_
7 #define FS_FILE_HPP_
8 
9 #include "Fs.hpp"
10 #include "FsDefs.hpp"
11 #include "FsEntry.hpp"
12 #include "FsPartition.hpp"
13 #include "RtosInclude.hpp"
14 
15 class FsFile: public FsEntry {
16  friend class Fs;
17 private:
18 
19 public:
20  FsFile();
21  ~FsFile();
22 
23  FsDefs::RESULT open(const char* path, bool readOnly = false);
24  FsDefs::RESULT create(const char* path, bool readOnly = false);
25  FsDefs::RESULT read(void* buffer, size_t len, size_t* transfered);
26  FsDefs::RESULT write(const void* buffer, size_t len, size_t* transfered);
27  FsDefs::RESULT seek(size_t position);
28  FsDefs::RESULT flush();
29  FsDefs::RESULT del(const char* path);
30  uint32_t getSize();
31  virtual FsDefs::RESULT close();
32 
33 };
34 
35 #endif /* FS_FILE_HPP_ */