Pervasive Displays Library Suite - Reference Manual 10.0.0
Library for Pervasive Displays e-paper screens, extension boards and development kits
File_TXT Class Reference

Write and read a text file on SD-card. More...

#include <hV_File_TXT.h>

Inheritance diagram for File_TXT:
[legend]
Collaboration diagram for File_TXT:
[legend]

Public Member Functions

 File_TXT (Screen_EPD *screen)
 Constructor object.
uint8_t openFile (STRING_CONST_TYPE name, uint8_t mode=FILE_WRITE_BEGIN)
 Open file on SD-card.
uint8_t writeFile (STRING_CONST_TYPE text)
 Write to file on SD-card.
uint8_t readFile (STRING_BYREF_TYPE text, uint8_t limit=64)
 Read from file on SD-card.
void closeFile ()
 Close the file on SD_card.
 File_TXT (Screen_EPD *screen)
 Constructor object.
uint8_t openFile (STRING_CONST_TYPE name, uint8_t mode=ios::out)
 Open file on SD-card.
uint8_t writeFile (STRING_CONST_TYPE text)
 Write to file on SD-card.
uint8_t readFile (STRING_BYREF_TYPE text, uint8_t limit=64)
 Read from file on SD-card.
void closeFile ()
 Close the file on SD_card.
Public Member Functions inherited from File_System
 File_System ()
 Constructor.
uint8_t beginFileSystem (uint8_t pinCS=NOT_CONNECTED, uint8_t port=0, int8_t pinDetect=-1, int level=LOW)
 File system initialisation.
uint8_t endFileSystem ()
 Close file system.
uint8_t setFolder (STRING_CONST_TYPE name)
 Set the folder for files.
uint8_t suspendFileSystem ()
 Suspend file system.
uint8_t resumeFileSystem ()
 Resume file system after suspend.
uint8_t saveScreen (STRING_CONST_TYPE name, uint8_t multiplier=1)
 Screen saved as file to SD-card.
uint8_t saveWindow (STRING_CONST_TYPE name, uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint8_t multiplier=1)
 Save partial window as file to SD-card.
uint8_t readScreen (STRING_CONST_TYPE name, uint8_t multiplier=1)
 Load and display BMP file.
void printFileSystemError ()
 Print the file system error.
 File_System ()
 Constructor.
uint8_t beginFileSystem (uint8_t pinCS=NOT_CONNECTED, uint8_t port=0, int8_t pinDetect=-1, int level=LOW)
 File system initialisation.
uint8_t endFileSystem ()
 Close file system.
uint8_t suspendFileSystem ()
 Suspend file system.
uint8_t resumeFileSystem ()
 Resume file system after suspend.
uint8_t saveScreen (STRING_CONST_TYPE name, uint8_t multiplier=1)
 Screen saved as file to SD-card.
uint8_t saveWindow (STRING_CONST_TYPE name, uint16_t x0, uint16_t y0, uint16_t dx, uint16_t dy, uint8_t multiplier=1)
 Save partial window as file to SD-card.
uint8_t readScreen (STRING_CONST_TYPE name, uint8_t multiplier=1)
 Load and display BMP file.
void printFileSystemError ()
 Print the file system error.

Detailed Description

Write and read a text file on SD-card.

Shared header for Linux and MCU

Warning
MCU requires an SD-card library

Constructor & Destructor Documentation

◆ File_TXT() [1/2]

File_TXT::File_TXT ( Screen_EPD * screen)

Constructor object.

Parameters
screen&screen to link File_TXT to

◆ File_TXT() [2/2]

File_TXT::File_TXT ( Screen_EPD * screen)

Constructor object.

Parameters
screen&screen to link File_TXT to

Member Function Documentation

◆ openFile() [1/2]

uint8_t File_TXT::openFile ( STRING_CONST_TYPE name,
uint8_t mode = FILE_WRITE_BEGIN )

Open file on SD-card.

Parameters
namefile name with extension, only letters and numbers
modeFILE_WRITE_BEGIN=default new file, FILE_WRITE to add, FILE_READ
Returns
RESULT_SUCCESS is successful, RESULT_ERROR otherwise
Note
The resulting file is a header file.

◆ openFile() [2/2]

uint8_t File_TXT::openFile ( STRING_CONST_TYPE name,
uint8_t mode = ios::out )

Open file on SD-card.

Parameters
namefile name with extension, only letters and numbers
modeFILE_WRITE_BEGIN=default new file, FILE_WRITE to add, FILE_READ
Returns
RESULT_SUCCESS is successful, RESULT_ERROR otherwise
Note
The resulting file is a header file.

◆ readFile() [1/2]

uint8_t File_TXT::readFile ( STRING_BYREF_TYPE text,
uint8_t limit = 64 )

Read from file on SD-card.

Parameters
[out]textalways by reference
[in]limitread characters up to number, default = 64
Returns
number of characters read

◆ readFile() [2/2]

uint8_t File_TXT::readFile ( STRING_BYREF_TYPE text,
uint8_t limit = 64 )

Read from file on SD-card.

Parameters
[out]textalways by reference
[in]limitread characters up to number, default = 64
Returns
number of characters read

◆ writeFile() [1/2]

uint8_t File_TXT::writeFile ( STRING_CONST_TYPE text)

Write to file on SD-card.

Parameters
[in]text
Returns
RESULT_SUCCESS is successful, RESULT_ERROR otherwise

◆ writeFile() [2/2]

uint8_t File_TXT::writeFile ( STRING_CONST_TYPE text)

Write to file on SD-card.

Parameters
[in]text
Returns
RESULT_SUCCESS is successful, RESULT_ERROR otherwise

The documentation for this class was generated from the following files: