FBB::ConfigFileile

FBB::ConfigFileile

libbobcat1-dev_2.02.03-x.tar.gz

2005-2009


FBB::ConfigFileile(3bobcat)

FBB::ConfigFileile(3bobcat)

libbobcat1-dev_2.02.03-x.tar.gz Configuration File Processing

2005-2009

NAME

FBB::ConfigFileile - A class processing standard unix-like configuration files

SYNOPSIS

#include <bobcat/configfile>
Linking option: -lbobcat

DESCRIPTION

FBB::ConfigFile objects read standard unix-style configuration files. Lines are stored with initial white-space (blanks and tabs) removed. If a line ends in \, then the next line (initial white-space removed) is appended to the current line.

Information at and beyond the first # on individual lines is removed if the rmComment flag is set to true. In that case, lines containing only blanks and tabs are not stored.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

std::vector<std::string>

ENUMERATIONS

The following enumerations are defined by the class FBB::ConfigFile:

CONSTRUCTORS

The copy constructor is available.

OVERLOADED OPERATORS

MEMBER FUNCTIONS

All members of std::vector<std::string> are available, as FBB::ConfigFile inherits from this class.

EXAMPLE

Assume the configuration file is called config.rc and contains the following lines:



# this is ignored

noline: this one too

line: this is found

this is not a line containing line: at the beginning of the line

line: this one is

    line: what about this one? \ 
        it's extending over multiple lines

and there may, of course, be more lines in this file
    

The following program may be compiled and run as a.out config.rc:


#include <iostream>
#include <iterator>
#include <algorithm>
#include <string>
#include <bobcat/configfile>

using namespace std;
using namespace FBB;
    
int main(int argc, char **argv)
{
    ConfigFile cf(argv[1]);     

    cout << *cf.find("this one") << endl; // find text within a line

                                         // find all lines matching 
                                         // `^line:'
    copy(cf.beginRE("^line:"), cf.endRE(), 
                    ostream_iterator<string>(cout, "\n"));
}
    

Producing the output:


noline: this one too
line: this is found
line: this one is
line: what about this one? it's extending over multiple lines
    

FILES

bobcat/configfile - defines the class interface

SEE ALSO

bobcat(7), errno(3bobcat), pattern(3bobcat)

BUGS

None Reported.

DISTRIBUTION FILES

BOBCAT

Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).