xrocusOS_ADXL355 version
Dependencies: mbed SDFileSystem
include/SDDataStore.h@20:2f2687580ecb, 2019-07-05 (annotated)
- Committer:
- APS_Lab
- Date:
- Fri Jul 05 02:09:06 2019 +0000
- Revision:
- 20:2f2687580ecb
- Parent:
- 5:a37e3a15444b
Ver0.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Inscape_ao | 5:a37e3a15444b | 1 | #ifndef _SDDATASTORE_H_ |
Inscape_ao | 5:a37e3a15444b | 2 | #define _SDDATASTORE_H_ |
Inscape_ao | 5:a37e3a15444b | 3 | |
Inscape_ao | 5:a37e3a15444b | 4 | #include "SDFileSystem.h" |
Inscape_ao | 5:a37e3a15444b | 5 | #include "TimeManager.h" |
Inscape_ao | 5:a37e3a15444b | 6 | |
Inscape_ao | 5:a37e3a15444b | 7 | class SDDataStore |
Inscape_ao | 5:a37e3a15444b | 8 | { |
Inscape_ao | 5:a37e3a15444b | 9 | public: |
Inscape_ao | 5:a37e3a15444b | 10 | const static int MaxPathLength = 256; |
Inscape_ao | 5:a37e3a15444b | 11 | private: |
Inscape_ao | 5:a37e3a15444b | 12 | SDFileSystem *pS; |
Inscape_ao | 5:a37e3a15444b | 13 | TimeManager *pT; |
Inscape_ao | 5:a37e3a15444b | 14 | FILE *fpCurrent; |
Inscape_ao | 5:a37e3a15444b | 15 | char fnameCurrent[MaxPathLength]; |
Inscape_ao | 5:a37e3a15444b | 16 | private: |
Inscape_ao | 5:a37e3a15444b | 17 | /* (INVALIDED) constructor */ |
Inscape_ao | 5:a37e3a15444b | 18 | SDDataStore(void); |
Inscape_ao | 5:a37e3a15444b | 19 | public: |
Inscape_ao | 5:a37e3a15444b | 20 | /* constructor, pSD, TimeManager */ |
Inscape_ao | 5:a37e3a15444b | 21 | SDDataStore(TimeManager *pSetTM); |
Inscape_ao | 5:a37e3a15444b | 22 | /* destructor */ |
Inscape_ao | 5:a37e3a15444b | 23 | ~SDDataStore(); |
Inscape_ao | 5:a37e3a15444b | 24 | /* for Sensing and Logging generate (prefix)TimeStampFile.(ext)*/ |
Inscape_ao | 5:a37e3a15444b | 25 | bool startFileWithTimeStamp(char *prefix, char *ext); |
Inscape_ao | 5:a37e3a15444b | 26 | /* checkFileExist, false=NOT-EXIST, true=EXIST */ |
Inscape_ao | 5:a37e3a15444b | 27 | bool checkFileExist(char *fname); |
Inscape_ao | 5:a37e3a15444b | 28 | /* removeFile, false=NOT-EXIST, true=EXIST */ |
Inscape_ao | 5:a37e3a15444b | 29 | void removeFile(char *fname); |
Inscape_ao | 5:a37e3a15444b | 30 | /* open file at WriteMode FALSE=ERR, TRUE=OK */ |
Inscape_ao | 5:a37e3a15444b | 31 | bool openFile(char *fname); |
Inscape_ao | 5:a37e3a15444b | 32 | /* get FileName of open file */ |
Inscape_ao | 5:a37e3a15444b | 33 | char *getFileName(void); |
Inscape_ao | 5:a37e3a15444b | 34 | /* get current file pointer */ |
Inscape_ao | 5:a37e3a15444b | 35 | FILE *getFilePointer(void); |
Inscape_ao | 5:a37e3a15444b | 36 | /* close file with this Class */ |
Inscape_ao | 5:a37e3a15444b | 37 | void syncFile(void); |
Inscape_ao | 5:a37e3a15444b | 38 | /* close file with this Class */ |
Inscape_ao | 5:a37e3a15444b | 39 | void closeFile(void); |
Inscape_ao | 5:a37e3a15444b | 40 | |
Inscape_ao | 5:a37e3a15444b | 41 | private: |
Inscape_ao | 5:a37e3a15444b | 42 | void pathTermination(char *pathArray); |
Inscape_ao | 5:a37e3a15444b | 43 | }; |
Inscape_ao | 5:a37e3a15444b | 44 | |
Inscape_ao | 5:a37e3a15444b | 45 | #endif /* _SDDATASTORE_H_ */ |