Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otConfigParser Class Reference
[File Configuration Parser - Configuration or setup by formatted text file]

#include <otConfigParser.h>


Public Types

enum  VarTypes {
  V_INT, V_FLOATING, V_STRING, V_S8,
  V_U8, V_S16, V_U16, V_F32,
  V_U32
}

Public Member Functions

 otConfigParser ()
bool init (U32 elements, otFILE *fs)
U32 addVariable (const char *name, U8 type, void *var)
bool parse (const char *filePath)


Detailed Description

This library implements a command parser for a formatted text file


Member Enumeration Documentation

enum otConfigParser::VarTypes
 

Enumeration values:
V_INT  32 bit with
V_FLOATING  64 bit floating point
V_STRING  8 bit text string
V_S8  8 bit with sign
V_U8  8 bit unsigned
V_S16  16 bit with sign
V_U16  16 bit unsigned
V_F32  32 bit floating point
V_U32  32 bit unsigned


Constructor & Destructor Documentation

otConfigParser.otConfigParser  ) 
 

Library creation.


Member Function Documentation

U32 otConfigParser.addVariable const char *  name,
U8  type,
void *  var
 

Allows you to associate a keyword and a variable

Parameters:
name Keyword name
type Variable type, see VarTypes
var Variable address
Returns:
Index in variable table

bool otConfigParser.init U32  elements,
otFILE fs
 

Init the class

Parameters:
elements Maximum number of keywords recognized
fs Class pointer to otFILE, for file access
Returns:
True on success

bool otConfigParser.parse const char *  filePath  ) 
 

Open and parse a file. The keywords present and recognized are read and loaded into the associated variables.

Parameters:
filePath File path name
Returns:
True on success


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0