xrocusOS_ADXL355 version
Dependencies: mbed SDFileSystem
Diff: include/SDDataStore.h
- Revision:
- 5:a37e3a15444b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/SDDataStore.h Wed Apr 24 02:34:51 2019 +0000 @@ -0,0 +1,45 @@ +#ifndef _SDDATASTORE_H_ +#define _SDDATASTORE_H_ + +#include "SDFileSystem.h" +#include "TimeManager.h" + +class SDDataStore +{ +public: + const static int MaxPathLength = 256; +private: + SDFileSystem *pS; + TimeManager *pT; + FILE *fpCurrent; + char fnameCurrent[MaxPathLength]; +private: + /* (INVALIDED) constructor */ + SDDataStore(void); +public: + /* constructor, pSD, TimeManager */ + SDDataStore(TimeManager *pSetTM); + /* destructor */ + ~SDDataStore(); + /* for Sensing and Logging generate (prefix)TimeStampFile.(ext)*/ + bool startFileWithTimeStamp(char *prefix, char *ext); + /* checkFileExist, false=NOT-EXIST, true=EXIST */ + bool checkFileExist(char *fname); + /* removeFile, false=NOT-EXIST, true=EXIST */ + void removeFile(char *fname); + /* open file at WriteMode FALSE=ERR, TRUE=OK */ + bool openFile(char *fname); + /* get FileName of open file */ + char *getFileName(void); + /* get current file pointer */ + FILE *getFilePointer(void); + /* close file with this Class */ + void syncFile(void); + /* close file with this Class */ + void closeFile(void); + +private: + void pathTermination(char *pathArray); +}; + +#endif /* _SDDATASTORE_H_ */ \ No newline at end of file