embkernel
 All Classes Functions Variables Typedefs Groups Pages
FsDir.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_DIR_HPP_
7 #define FS_DIR_HPP_
8 
9 #include "FsEntry.hpp"
10 #include <stdlib.h>
11 
12 class FsDir: public FsEntry {
13 public:
14  FsDir();
15  ~FsDir();
16 
17  typedef struct ENTRY_INFO {
18  char shortFileName[13];
19  const char* longFileName;
20  FsDefs::ATTRIBUTES attributes;
21  uint8_t createTimeMs;
22  FsDefs::TIME createTime;
23  FsDefs::DATE createDate;
24  FsDefs::DATE lastAccess;
25  FsDefs::TIME lastModifiedTime;
26  FsDefs::DATE lastModifiedDate;
27  uint32_t fileSize;
28  ENTRY_INFO() {
29  longFileName = 0;
30  }
31  ~ENTRY_INFO() {
32  if (longFileName) {
33  free((void*) longFileName);
34  }
35  }
36  ;
37  } ENTRY_INFO;
38 
39  FsDefs::RESULT open(const char* path);
40  FsDefs::RESULT create(const char* path);
41  FsDefs::RESULT del(const char* path);
42  FsDefs::RESULT rewind();
43  FsDefs::RESULT getNextEntry(ENTRY_INFO* entryInfo);
44  virtual FsDefs::RESULT close();
45 };
46 
47 #endif /* FS_DIR_HPP_ */