cfg_LibraryFile Class Reference
[Parser for config files; validation]

#include <cfg_library.h>

Inheritance diagram for cfg_LibraryFile:

Inheritance graph
[legend]
Collaboration diagram for cfg_LibraryFile:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 45 of file cfg_library.h.


Public Member Functions

 cfg_LibraryFile ()
 cfg_LibraryFile (const pf_File &a_parsedFile)
virtual ~cfg_LibraryFile ()
void Refresh (const pf_File &a_parsedFile)
virtual void ConvertGroup (const string &a_productID, const pf_Group &a_group)
const cfg_LibraryFindLibrary (const string &a_vendor, const string &a_product) const

Private Attributes

 log_CLASSID_m
vector< cfg_Librarym_libraries

Constructor & Destructor Documentation

cfg_LibraryFile::cfg_LibraryFile (  ) 

cfg_LibraryFile::cfg_LibraryFile ( const pf_File a_parsedFile  ) 

Definition at line 63 of file cfg_library.cpp.

References log_FUNC_m, and Refresh().

00063                                                             {
00064     log_FUNC_m(cfg_LibraryFile);
00065     Refresh(a_parsedFile);
00066 }

Here is the call graph for this function:

cfg_LibraryFile::~cfg_LibraryFile (  )  [virtual]

Definition at line 70 of file cfg_library.cpp.

References log_FUNC_m.

00070                                   {
00071     log_FUNC_m(~cfg_LibraryFile);
00072 }


Member Function Documentation

void cfg_LibraryFile::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 76 of file cfg_library.cpp.

References cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), dbg_NORM, log_DBG_m, log_FUNC_m, pf_File::m_common, and m_libraries.

Referenced by cfg_LibraryFile().

00076                                                          {
00077     log_FUNC_m(Refresh);
00078 
00079     ConvertFileHeader(a_parsedFile);
00080     val_RuleVec  rules;
00081 
00082     Convert(a_parsedFile.m_common, rules);
00083 
00084     log_DBG_m(dbg_NORM, "Parsed " << m_libraries.size() << " entries.");
00085 }

Here is the call graph for this function:

Here is the caller graph for this function:

void cfg_LibraryFile::ConvertGroup ( const string &  a_productID,
const pf_Group a_group 
) [virtual]

Reimplemented from cfg_Base.

Definition at line 89 of file cfg_library.cpp.

References log_FUNC_m, and m_libraries.

00090                                                         {
00091     log_FUNC_m(ConvertGroup);
00092 
00093     cfg_Library lib(a_productID, a_group);
00094     m_libraries.push_back(lib);
00095 }

const cfg_Library * cfg_LibraryFile::FindLibrary ( const string &  a_vendor,
const string &  a_product 
) const

Definition at line 99 of file cfg_library.cpp.

References dbg_LOW, dbg_NORM, log_DBG_m, log_FUNC_m, m_libraries, and NULL.

Referenced by la_SCSILibrary::Open().

00100                                                            {
00101     log_FUNC_m(FindLibrary);
00102 
00103     vector<cfg_Library>::const_iterator lib_i;
00104     for (lib_i = m_libraries.begin(); lib_i != m_libraries.end(); ++lib_i) {
00105 
00106         const string& tblVendor((*lib_i).m_vendorID);
00107         const string& tblProduct((*lib_i).m_productID);
00108 
00109         //
00110         // Compare only strings up to the length of the string in the
00111         // config file.
00112         //
00113         string subVendor(a_vendor.substr(0, tblVendor.size()) );
00114         string subProduct(a_product.substr(0, tblProduct.size()) );
00115 
00116         if (tblVendor == subVendor && tblProduct == subProduct) {
00117 
00118             log_DBG_m(dbg_NORM,
00119                 "Found properties for \'" << a_vendor << "\', \'" << a_product << "\'" <<
00120                 "(cfg \'" << tblVendor << "\', \'" << tblProduct << "\')" );
00121 
00122             return &(*lib_i);
00123         };
00124     }
00125 
00126     log_DBG_m(dbg_LOW,
00127         "No properties for \'" << a_vendor << "\', \'" << a_product << "\'");
00128 
00129     return NULL;
00130 
00131 }

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from cfg_Base.

Definition at line 58 of file cfg_library.h.

Definition at line 60 of file cfg_library.h.

Referenced by ConvertGroup(), FindLibrary(), and Refresh().


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

Generated on Mon Feb 27 19:03:55 2012 for OPENARCHIVE by  doxygen 1.5.6