Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

aflibEnvFile Class Reference

Manages settings for each individual of a program. More...

#include <aflibEnvFile.h>

List of all members.

Public Methods

 aflibEnvFile (char *env_file, char *env_dir=NULL)
 Constructor with parameters. More...

 aflibEnvFile ()
 ~aflibEnvFile ()
 Destructor.

bool readValueFromFile (string &key_str, string &results)
 Read a value from a file. More...

void writeValueToFile (string &key_str, string &value)
 Write a value to a file. More...


Detailed Description

Manages settings for each individual of a program.

This class will create a .<name> directory in the users home directory or a directory for the users choice. It will then manage a set of key values that the programmer can search for. This allows programmers to save a users settings and then retrieve then at a latter time. It currently supports upto 1024 different settings. Two constructors are provided. They will dertermine what directory to look for the settings file and what the name of the file is. If the directory is not specified then a default directory of .<DEFAULT_DIR> will be created in the users home directory. A file will be created in this directory. The name will be the one specified by the caller. If none is specified then DEFAULT_FILE will be created. To retrieve and store strings into the file readValueFromFile and writeValueToFile should be called.


Constructor & Destructor Documentation

aflibEnvFile::aflibEnvFile ( char * env_file,
char * env_dir = NULL )
 

Constructor with parameters.

This will create a environment directory name to use with env_dir. If this is NULL then a default directory in the users home directory will be used. If env_file is set then this file name will be used in the env_dir. Otherwise a default file name will be used in the env_dir.

aflibEnvFile::aflibEnvFile ( )
 

Constructor with no parameters.

This constructor will use defaults for the directory and env files.

aflibEnvFile::~aflibEnvFile ( )
 

Destructor.


Member Function Documentation

bool aflibEnvFile::readValueFromFile ( string & key_str,
string & results )
 

Read a value from a file.

This function will read a string from the env file that corresponds to the key key_str passed in.

void aflibEnvFile::writeValueToFile ( string & key_str,
string & value )
 

Write a value to a file.

This function will write a value for the key key_str. If the key_str already exists then it will be overwritten.


The documentation for this class was generated from the following files:
Generated at Tue Aug 7 22:18:07 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001