VEX V5 C++ API
|
Use the SD Card class to load or save files on your SD card. More...
Public Member Functions | |
sdcard () | |
~sdcard () | |
bool | isInserted () |
Gets the state of the SD card. More... | |
int32_t | loadfile (const char *name, uint8_t *buffer, int32_t len) |
Loads a file from the SD card. More... | |
int32_t | loadtextfile (const char *name, char *textBuffer, int32_t len) |
Loads a text file from the SD card. More... | |
int32_t | filesize (const char *name) |
Get the size of a file on the SD card. More... | |
int32_t | savefile (const char *name, uint8_t *buffer, int32_t len) |
Saves a file to the SD card. More... | |
int32_t | savetextfile (const char *name, const char *text) |
Saves data to a text file. More... | |
int32_t | appendfile (const char *name, uint8_t *buffer, int32_t len) |
Appends data to an existing file. More... | |
int32_t | appendtextfile (const char *name, const char *text) |
Appends data to an existing text file. More... | |
Use the SD Card class to load or save files on your SD card.
vex::brain::sdcard::sdcard | ( | ) |
vex::brain::sdcard::~sdcard | ( | ) |
bool vex::brain::sdcard::isInserted | ( | ) |
Gets the state of the SD card.
int32_t vex::brain::sdcard::loadfile | ( | const char * | name, |
uint8_t * | buffer, | ||
int32_t | len | ||
) |
Loads a file from the SD card.
name | The name of the file, use either '/' or '\' for directory separator. |
buffer | Pointer to a buffer for file data. |
len | The length of the buffer in bytes. Usually set to the max length of the buffer. |
int32_t vex::brain::sdcard::loadtextfile | ( | const char * | name, |
char * | textBuffer, | ||
int32_t | len | ||
) |
Loads a text file from the SD card.
name | The name of the file, use either '/' or '\' for directory separator. |
textBuffer | a buffer for text data. Remember to allocate one extra byte for the null-terminator character (sdcard.filesize + 1). |
len | The length of the buffer in bytes. Usually set to the max length of the buffer. |
int32_t vex::brain::sdcard::filesize | ( | const char * | name | ) |
Get the size of a file on the SD card.
name | The name of the file, use either '/' or '\' for directory separator. |
int32_t vex::brain::sdcard::savefile | ( | const char * | name, |
uint8_t * | buffer, | ||
int32_t | len | ||
) |
Saves a file to the SD card.
name | The name of the file, use either '/' or '\' for directory separator. |
buffer | Pointer to a buffer with file data. |
len | The length of the buffer in bytes. Usually set to the max length of the buffer. |
int32_t vex::brain::sdcard::savetextfile | ( | const char * | name, |
const char * | text | ||
) |
Saves data to a text file.
name | The name of the file, use either '/' or '\' for directory separator. |
text | a null-terminated C string to save. |
int32_t vex::brain::sdcard::appendfile | ( | const char * | name, |
uint8_t * | buffer, | ||
int32_t | len | ||
) |
Appends data to an existing file.
name | The name of the file, use either '/' or '\' for directory separator. |
buffer | Pointer to a buffer with file data. |
len | The length of the buffer in bytes. Usually set to the max length of the buffer. |
int32_t vex::brain::sdcard::appendtextfile | ( | const char * | name, |
const char * | text | ||
) |
Appends data to an existing text file.
name | The name of the file, use either '/' or '\' for directory separator. |
text | a null-terminated C string to append. |