xrocusOS_ADXL355 version

Dependencies:   mbed SDFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDDataStore.h Source File

SDDataStore.h

00001 #ifndef _SDDATASTORE_H_
00002 #define _SDDATASTORE_H_
00003 
00004 #include "SDFileSystem.h"
00005 #include "TimeManager.h"
00006 
00007 class SDDataStore
00008 {
00009 public:
00010     const static int MaxPathLength = 256;        
00011 private:    
00012     SDFileSystem *pS;
00013     TimeManager *pT;
00014     FILE *fpCurrent;
00015     char fnameCurrent[MaxPathLength];
00016 private:
00017     /* (INVALIDED) constructor */
00018     SDDataStore(void);
00019 public:
00020     /* constructor, pSD, TimeManager */
00021     SDDataStore(TimeManager *pSetTM);
00022     /* destructor */
00023     ~SDDataStore();
00024     /* for Sensing and Logging generate (prefix)TimeStampFile.(ext)*/
00025     bool startFileWithTimeStamp(char *prefix, char *ext);
00026     /* checkFileExist, false=NOT-EXIST, true=EXIST */
00027     bool checkFileExist(char *fname);
00028     /* removeFile, false=NOT-EXIST, true=EXIST */
00029     void removeFile(char *fname);
00030     /* open file at WriteMode FALSE=ERR, TRUE=OK */
00031     bool openFile(char *fname);
00032     /* get FileName of open file */
00033     char *getFileName(void);
00034     /* get current file pointer  */
00035     FILE *getFilePointer(void);
00036     /* close file with this Class  */
00037     void syncFile(void);
00038     /* close file with this Class  */
00039     void closeFile(void);
00040     
00041 private:
00042     void pathTermination(char *pathArray);
00043 };
00044 
00045 #endif /* _SDDATASTORE_H_ */