Public Member Functions | Private Attributes

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.

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

Detailed Description

Definition at line 59 of file cfg_library.h.


Constructor & Destructor Documentation

cfg_LibraryFile::cfg_LibraryFile (  ) 
cfg_LibraryFile::cfg_LibraryFile ( const pf_File a_parsedFile  ) 

Definition at line 77 of file cfg_library.cpp.

References log_FUNC_m, and Refresh().

                                                            {
    log_FUNC_m(cfg_LibraryFile);
    Refresh(a_parsedFile);
}

Here is the call graph for this function:

cfg_LibraryFile::~cfg_LibraryFile (  )  [virtual]

Definition at line 84 of file cfg_library.cpp.

References log_FUNC_m.


Member Function Documentation

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

Reimplemented from cfg_Base.

Definition at line 103 of file cfg_library.cpp.

References log_FUNC_m, and m_libraries.

                                                        {
    log_FUNC_m(ConvertGroup);

    cfg_Library lib(a_productID, a_group);
    m_libraries.push_back(lib);
}

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

Definition at line 113 of file cfg_library.cpp.

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

Referenced by la_SCSILibrary::Open().

                                                           {
    log_FUNC_m(FindLibrary);

    vector<cfg_Library>::const_iterator lib_i;
    for (lib_i = m_libraries.begin(); lib_i != m_libraries.end(); ++lib_i) {

        const string& tblVendor((*lib_i).m_vendorID);
        const string& tblProduct((*lib_i).m_productID);

        //
        // Compare only strings up to the length of the string in the
        // config file.
        //
        string subVendor(a_vendor.substr(0, tblVendor.size()) );
        string subProduct(a_product.substr(0, tblProduct.size()) );

        if (tblVendor == subVendor && tblProduct == subProduct) {

            log_DBG_m(dbg_NORM,
                "Found properties for \'" << a_vendor << "\', \'" << a_product << "\'" <<
                "(cfg \'" << tblVendor << "\', \'" << tblProduct << "\')" );

            return &(*lib_i);
        };
    }

    log_DBG_m(dbg_LOW,
        "No properties for \'" << a_vendor << "\', \'" << a_product << "\'");

    return NULL;

}

Here is the caller graph for this function:

void cfg_LibraryFile::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 90 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().

                                                         {
    log_FUNC_m(Refresh);

    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;

    Convert(a_parsedFile.m_common, rules);

    log_DBG_m(dbg_NORM, "Parsed " << m_libraries.size() << " entries.");
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from cfg_Base.

Definition at line 72 of file cfg_library.h.

Definition at line 74 of file cfg_library.h.

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


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