CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::PfnEditor Class Reference

#include <PfnEditor.h>

List of all members.

Public Member Functions

std::string operator() (std::string const &pfn) const
 PfnEditor ()
 PfnEditor (std::string const &ipre, std::string const &ipos)

Private Attributes

bool off
std::string postfix
std::string prefix

Detailed Description

Definition at line 10 of file PfnEditor.h.


Constructor & Destructor Documentation

cond::PfnEditor::PfnEditor ( )

Definition at line 5 of file PfnEditor.cc.

: off(true){}
cond::PfnEditor::PfnEditor ( std::string const &  ipre,
std::string const &  ipos 
)

Definition at line 7 of file PfnEditor.cc.

                                               : 
    prefix(ipre), 
    postfix(ipos),
    off(prefix.empty() && postfix.empty())
  {}

Member Function Documentation

std::string cond::PfnEditor::operator() ( std::string const &  pfn) const

Definition at line 15 of file PfnEditor.cc.

References off, dbtoconf::pfn, pos, postfix, and prefix.

                                                             {
    if (off) return pfn;
    // FIXME ad-hoc
    if (pfn.find("FrontierInt")!=std::string::npos)  return pfn;
    if (pfn.find("FrontierPrep")!=std::string::npos)  return pfn;
    if (pfn.find("sqlite")!=std::string::npos)  return pfn;
    
    size_t pos=std::string::npos;
    if (!prefix.empty()) pos = pfn.rfind('/');
    return prefix + ( (pos == std::string::npos) ? pfn :
                      pfn.substr(pos+1)
                      ) + postfix;
  }

Member Data Documentation

bool cond::PfnEditor::off [private]

Definition at line 21 of file PfnEditor.h.

Referenced by operator()().

std::string cond::PfnEditor::postfix [private]

Definition at line 20 of file PfnEditor.h.

Referenced by operator()().

std::string cond::PfnEditor::prefix [private]

Definition at line 19 of file PfnEditor.h.

Referenced by operator()().