TeensyNanoExoCode
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
IniFile Class Reference

#include <IniFile.h>

Public Types

enum  error_t {
  errorNoError = 0 , errorFileNotFound , errorFileNotOpen , errorBufferTooSmall ,
  errorSeekError , errorSectionNotFound , errorKeyNotFound , errorEndOfFile ,
  errorUnknownError
}
 
typedef uint8_t mode_t
 

Public Member Functions

 IniFile (const char *filename, mode_t mode=FILE_READ, bool caseSensitive=false)
 
 ~IniFile ()
 
bool open (void)
 
void close (void)
 
bool isOpen (void) const
 
error_t getError (void) const
 
void clearError (void) const
 
mode_t getMode (void) const
 
const char * getFilename (void) const
 
bool validate (char *buffer, size_t len) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, IniFileState &state) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, char *value, size_t vlen) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, bool &b) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, int &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, double &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, uint8_t &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, uint16_t &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, long &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, unsigned long &val) const
 
bool getValue (const char *section, const char *key, char *buffer, size_t len, float &val) const
 
bool getIPAddress (const char *section, const char *key, char *buffer, size_t len, uint8_t *ip) const
 
bool getMACAddress (const char *section, const char *key, char *buffer, size_t len, uint8_t mac[6]) const
 
bool browseSections (char *buffer, size_t len, IniFileState &state) const
 
bool getCaseSensitive (void) const
 
void setCaseSensitive (bool cs)
 

Static Public Member Functions

static error_t readLine (File &file, char *buffer, size_t len, uint32_t &pos)
 
static bool isCommentChar (char c)
 
static char * skipWhiteSpace (char *str)
 
static void removeTrailingWhiteSpace (char *str)
 

Static Public Attributes

static const uint8_t maxFilenameLen = INI_FILE_MAX_FILENAME_LEN
 

Protected Member Functions

bool findSection (const char *section, char *buffer, size_t len, IniFileState &state) const
 
bool findKey (const char *section, const char *key, char *buffer, size_t len, char **keyptr, IniFileState &state) const
 

Member Typedef Documentation

◆ mode_t

typedef uint8_t IniFile::mode_t

Member Enumeration Documentation

◆ error_t

Enumerator
errorNoError 
errorFileNotFound 
errorFileNotOpen 
errorBufferTooSmall 
errorSeekError 
errorSectionNotFound 
errorKeyNotFound 
errorEndOfFile 
errorUnknownError 

Constructor & Destructor Documentation

◆ IniFile()

IniFile::IniFile ( const char *  filename,
mode_t  mode = FILE_READ,
bool  caseSensitive = false 
)

◆ ~IniFile()

IniFile::~IniFile ( )

Member Function Documentation

◆ browseSections()

bool IniFile::browseSections ( char *  buffer,
size_t  len,
IniFileState state 
) const
Here is the call graph for this function:

◆ clearError()

void IniFile::clearError ( void  ) const
inline

◆ close()

void IniFile::close ( void  )
inline

◆ findKey()

bool IniFile::findKey ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
char **  keyptr,
IniFileState state 
) const
protected
Here is the call graph for this function:

◆ findSection()

bool IniFile::findSection ( const char *  section,
char *  buffer,
size_t  len,
IniFileState state 
) const
protected
Here is the call graph for this function:

◆ getCaseSensitive()

bool IniFile::getCaseSensitive ( void  ) const

◆ getError()

IniFile::error_t IniFile::getError ( void  ) const
inline

◆ getFilename()

const char * IniFile::getFilename ( void  ) const
inline

◆ getIPAddress()

bool IniFile::getIPAddress ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
uint8_t *  ip 
) const
Here is the call graph for this function:

◆ getMACAddress()

bool IniFile::getMACAddress ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
uint8_t  mac[6] 
) const
Here is the call graph for this function:

◆ getMode()

IniFile::mode_t IniFile::getMode ( void  ) const
inline

◆ getValue() [1/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len 
) const
Here is the call graph for this function:

◆ getValue() [2/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
bool &  b 
) const
Here is the call graph for this function:

◆ getValue() [3/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
char *  value,
size_t  vlen 
) const
Here is the call graph for this function:

◆ getValue() [4/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
double &  val 
) const
Here is the call graph for this function:

◆ getValue() [5/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
float &  val 
) const
Here is the call graph for this function:

◆ getValue() [6/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
IniFileState state 
) const
Here is the call graph for this function:

◆ getValue() [7/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
int &  val 
) const
Here is the call graph for this function:

◆ getValue() [8/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
long &  val 
) const
Here is the call graph for this function:

◆ getValue() [9/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
uint16_t &  val 
) const
Here is the call graph for this function:

◆ getValue() [10/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
uint8_t &  val 
) const
Here is the call graph for this function:

◆ getValue() [11/11]

bool IniFile::getValue ( const char *  section,
const char *  key,
char *  buffer,
size_t  len,
unsigned long &  val 
) const
Here is the call graph for this function:

◆ isCommentChar()

bool IniFile::isCommentChar ( char  c)
static

◆ isOpen()

bool IniFile::isOpen ( void  ) const
inline

◆ open()

bool IniFile::open ( void  )
inline
Here is the call graph for this function:

◆ readLine()

IniFile::error_t IniFile::readLine ( File &  file,
char *  buffer,
size_t  len,
uint32_t &  pos 
)
static

◆ removeTrailingWhiteSpace()

void IniFile::removeTrailingWhiteSpace ( char *  str)
static

◆ setCaseSensitive()

void IniFile::setCaseSensitive ( bool  cs)

◆ skipWhiteSpace()

char * IniFile::skipWhiteSpace ( char *  str)
static

◆ validate()

bool IniFile::validate ( char *  buffer,
size_t  len 
) const
Here is the call graph for this function:

Member Data Documentation

◆ maxFilenameLen

const uint8_t IniFile::maxFilenameLen = INI_FILE_MAX_FILENAME_LEN
static

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