Fast Research Interface Library  Manual and Documentation
Public Member Functions | Protected Member Functions | Protected Attributes
InitializationFileEntry Class Reference

A simple implementation of a class for reading an initialization file. More...

#include <InitializationFileEntry.h>

List of all members.

Public Member Functions

 InitializationFileEntry (const char *FileName=NULL)
 Constructor.
 ~InitializationFileEntry (void)
 Destructor.
char * GetAll (void)
 Returns a complete entry.
bool FindEntry (const char *Name)
 Looks for an entry that matches Name.
char * GetValue (void)
 Returns the value of the current entry (may be empty)
char * GetName (void)
 Returns the name of the current entry.
char * GetSection (void)
 Returns the name of the current section (may be empty)
bool NextEntry (void)
 Set the internal current entry pointer to the successor of the current entry.

Protected Member Functions

bool FindNextSection (void)
 Set the internal current entry pointer to the beginning of the next section.
bool Add (const char *Line)
 Add a line to the list.
void ReadFile (const char *FileName)
 Reads the initialization file.

Protected Attributes

InitializationFileEntryCurrentEntry
 A pointer to the current entry of the parsed initialization file.
InitializationFileEntryPrev
 A pointer to the previous entry of the parsed initialization file.
InitializationFileEntryNext
 A pointer to the next entry of the parsed initialization file.
char Name [NAMELEN]
 An array of char values used by the method InitializationFileEntry::GetName() to return the name of the current entry.
char Value [VALUELEN]
 An array of char values containing the value of the current entry.
char EntryName [NAMELEN]
 An array of char values containing the name of the current entry.
char SectionName [NAMELEN]
 An array of char values containing the name of the section of the current entry.
char CurrentSectionName [NAMELEN]
 An array of char values containing the name of the section of the current entry used by InitializationFileEntry::Add() if a new section was found.

Detailed Description

A simple implementation of a class for reading an initialization file.

Attention:
The implementation of this class does not feature real-time behavior.
See also:
The Initialization File for the Fast Research Interface Library
InitializationFileEntry::InitializationFileEntry()

Definition at line 95 of file InitializationFileEntry.h.


Constructor & Destructor Documentation

InitializationFileEntry::InitializationFileEntry ( const char *  FileName = NULL)

Constructor.

The constructor reads all entry from the initialization file Filename and creates a double-linked list of InitializationFileEntry objects.

Parameters:
FileNameA pointer to an array of char containing the name of the file that provides the desired initialization values/parameters
Attention:
The implementation of the constructor does not feature real-time behavior.
See also:
The Initialization File for the Fast Research Interface Library

Definition at line 67 of file InitializationFileEntry.cpp.

Destructor.

The destructor deletes all list entries.

Attention:
The implementation of the constructor does not feature real-time behavior.

Definition at line 90 of file InitializationFileEntry.cpp.


Member Function Documentation

bool InitializationFileEntry::Add ( const char *  Line) [protected]

Add a line to the list.

  • A line containing [name] introduces a new section.
  • A '=' may be used to separate an entry name and it's value.
  • A general line (without [,] and =) will be used as entry name
Parameters:
LineA pointer to an array of char values containing the line to be added.
Returns:
  • true if the line could be added
  • false otherwise

Definition at line 117 of file InitializationFileEntry.cpp.

bool InitializationFileEntry::FindEntry ( const char *  Name)

Looks for an entry that matches Name.

If one could be found it sets the internal current entry pointer to this entry and returns true. Otherwise, the current entry pointer will remain unchanged and the return value is false.

Parameters:
NameA pointer to an array of char values containing the name of the entry to be looked for
Returns:
  • true if the entry Name was found
  • false otherwise

Definition at line 345 of file InitializationFileEntry.cpp.

bool InitializationFileEntry::FindNextSection ( void  ) [protected]

Set the internal current entry pointer to the beginning of the next section.

Returns:
  • true if another section exists
  • false otherwise

Definition at line 229 of file InitializationFileEntry.cpp.

Returns a complete entry.

Returns:
A pointer to an array of char values containing the current entry

Definition at line 293 of file InitializationFileEntry.cpp.

Returns the name of the current entry.

Note:
The pointer will remain valid until the next call of GetName().
Returns:
A pointer to an array of char values containing the name of the current entry

Definition at line 306 of file InitializationFileEntry.cpp.

Returns the name of the current section (may be empty)

Returns:
A pointer to an array of char values containing the name of the current entry section.

Definition at line 280 of file InitializationFileEntry.cpp.

Returns the value of the current entry (may be empty)

Returns:
A pointer to an array of char values containing the value of the current entry

Definition at line 332 of file InitializationFileEntry.cpp.

Set the internal current entry pointer to the successor of the current entry.

Returns:
  • true if another entry exists
  • false otherwise

Definition at line 209 of file InitializationFileEntry.cpp.

void InitializationFileEntry::ReadFile ( const char *  FileName) [protected]

Reads the initialization file.

This method reads the contents of the file FileName and stores it in the InitializationFileEntry list.

Parameters:
FileNameA pointer to an array of char values containing the file name

Definition at line 382 of file InitializationFileEntry.cpp.


Member Data Documentation

A pointer to the current entry of the parsed initialization file.

Definition at line 283 of file InitializationFileEntry.h.

An array of char values containing the name of the section of the current entry used by InitializationFileEntry::Add() if a new section was found.

Definition at line 349 of file InitializationFileEntry.h.

An array of char values containing the name of the current entry.

Definition at line 329 of file InitializationFileEntry.h.

An array of char values used by the method InitializationFileEntry::GetName() to return the name of the current entry.

Definition at line 311 of file InitializationFileEntry.h.

A pointer to the next entry of the parsed initialization file.

Definition at line 301 of file InitializationFileEntry.h.

A pointer to the previous entry of the parsed initialization file.

Definition at line 292 of file InitializationFileEntry.h.

An array of char values containing the name of the section of the current entry.

Definition at line 338 of file InitializationFileEntry.h.

An array of char values containing the value of the current entry.

Definition at line 320 of file InitializationFileEntry.h.


The documentation for this class was generated from the following files:
This document was generated with Doxygen on Thu Apr 12 2012 11:18:55. User documentation of the Fast Research Interface Library for the KUKA Lightweight Robot IV by the Stanford Robotics Research Group. Copyright 2010–2012.