Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
ARex::Config Class Reference

Core configuration class. More...

#include <configcore.h>

Collaboration diagram for ARex::Config:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Config ()
 ~Config ()
void AddConfGrp (const ConfGrp &confgrp)
const ConfGrpFindConfGrp (const std::string &section, const std::string &id) const
const std::list< ConfGrp > & GetConfigs () const
 Returns the parsed options.
std::list< std::string > ConfValue (const std::string &path) const
 Get the configuration values from key.
std::string FirstConfValue (const std::string &path) const
 Get the first configuration value from key.

Private Attributes

std::list< ConfGrpconfigs

Detailed Description

Core configuration class.

Definition at line 74 of file configcore.h.


Constructor & Destructor Documentation

Definition at line 99 of file configcore.cpp.

{}

Definition at line 101 of file configcore.cpp.

{}

Member Function Documentation

void ARex::Config::AddConfGrp ( const ConfGrp confgrp)

Definition at line 103 of file configcore.cpp.

                                              {
       configs.push_back(confgrp);
}

Here is the caller graph for this function:

std::list< std::string > ARex::Config::ConfValue ( const std::string &  path) const

Get the configuration values from key.

Definition at line 120 of file configcore.cpp.

                                                                {
       try {
              std::string id;
              std::string::size_type pos1 = path.find('@');
              if (pos1 != std::string::npos)
                     id = path.substr(0, pos1++);
              else
                     pos1 = 0;
              std::string::size_type pos2 = path.rfind('/');
              if (pos2 == std::string::npos || pos2 < pos1)
                     throw ConfigError("Illegal configuration path");
              return FindConfGrp(path.substr(pos1, pos2 - pos1),
                                 id).FindOptionValue(path.substr(pos2 + 1));
       }
       catch(ConfigError) {
              return std::list<std::string>();
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const ConfGrp & ARex::Config::FindConfGrp ( const std::string &  section,
const std::string &  id 
) const

Definition at line 107 of file configcore.cpp.

                                                              {
       for (std::list<ConfGrp>::const_reverse_iterator it = configs.rbegin();
            it != configs.rend(); it++)
              if (it->GetSection() == section && it->GetID() == id)
                     return *it;
       throw ConfigError("Configuration group not defined");
}

Here is the caller graph for this function:

std::string ARex::Config::FirstConfValue ( const std::string &  path) const

Get the first configuration value from key.

This is meant as a short cut when it is known that the key is not multivalued.

Definition at line 140 of file configcore.cpp.

                                                            {
       std::list<std::string> values = ConfValue(path);
       if (!values.empty())
              return values.front();
       else
              return std::string();
}

Here is the call graph for this function:

const std::list< ConfGrp > & ARex::Config::GetConfigs ( ) const

Returns the parsed options.

Definition at line 116 of file configcore.cpp.

                                                 {
       return configs;
}

Here is the caller graph for this function:


Member Data Documentation

std::list<ConfGrp> ARex::Config::configs [private]

Definition at line 99 of file configcore.h.


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