storage.hpp
Go to the documentation of this file.
1 /*
2  * SocialLedge.com - Copyright (C) 2013
3  *
4  * This file is part of free software framework for embedded processors.
5  * You can use it and/or distribute it as long as this copyright header
6  * remains unmodified. The code is free for personal use and requires
7  * permission to use in a commercial product.
8  *
9  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
10  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
12  * I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
13  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
14  *
15  * You can reach the author of this software at :
16  * p r e e t . w i k i @ g m a i l . c o m
17  */
18 
24 #ifndef STORAGE_HPP__
25 #define STORAGE_HPP__
26 
27 #include "src/FileSystemObject.hpp"
28 
29 
30 
44 class Storage
45 {
46  public:
49  {
50  static FileSystemObject* pFlashDrive = new FileSystemObject(driveNumFlashMem);
51  return *pFlashDrive;
52  }
53 
56  {
57  static FileSystemObject* pSDCardDrive = new FileSystemObject(driveNumSdCard);
58  return *pSDCardDrive;
59  }
60 
69  static FRESULT copy(const char* pExistingFile, const char* pNewFile,
70  unsigned int* pReadTime=0, unsigned int* pWriteTime=0,
71  unsigned int* pBytesTransferred=0);
72 
80  static FRESULT read(const char* pFilename, void* pData, unsigned int bytesToRead, unsigned int offset=0);
81 
89  static FRESULT write(const char* pFilename, void* pData, unsigned int bytesToWrite, unsigned int offset=0);
90 
99  static FRESULT append(const char* pFilename, const void* pData, unsigned int bytesToAppend, unsigned int offset=0);
100 
101  private:
103  Storage() {}
104 };
105 
106 
107 #endif /* STORAGE_HPP__ */
This class provides class for File System.
static FRESULT read(const char *pFilename, void *pData, unsigned int bytesToRead, unsigned int offset=0)
Definition: storage.cpp:88
static FileSystemObject & getSDDrive()
Definition: storage.hpp:55
Definition: diskio.h:14
Definition: storage.hpp:44
static FRESULT append(const char *pFilename, const void *pData, unsigned int bytesToAppend, unsigned int offset=0)
Definition: storage.cpp:126
FRESULT
Definition: ff.h:180
Definition: FileSystemObject.hpp:38
static FRESULT write(const char *pFilename, void *pData, unsigned int bytesToWrite, unsigned int offset=0)
Definition: storage.cpp:107
static FRESULT copy(const char *pExistingFile, const char *pNewFile, unsigned int *pReadTime=0, unsigned int *pWriteTime=0, unsigned int *pBytesTransferred=0)
Definition: storage.cpp:25
Definition: diskio.h:13
static FileSystemObject & getFlashDrive()
Definition: storage.hpp:48