LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::TKeyVFSOpenPolicy Class Reference

#include "TKeyVFSOpenPolicy.h"

Public Member Functions

 TKeyVFSOpenPolicy (TFile *const tfile, int const flags=SQLITE_OPEN_READONLY)
 
sqlite3 * open (std::string const &key)
 

Private Attributes

TFile * tfile_
 
int flags_
 

Detailed Description

Definition at line 11 of file TKeyVFSOpenPolicy.h.

Constructor & Destructor Documentation

art::TKeyVFSOpenPolicy::TKeyVFSOpenPolicy ( TFile *const  tfile,
int const  flags = SQLITE_OPEN_READONLY 
)
explicit

Definition at line 6 of file TKeyVFSOpenPolicy.cc.

References flags_.

7  : tfile_{tfile}, flags_{flags | SQLITE_OPEN_URI}
8 {}

Member Function Documentation

sqlite3 * art::TKeyVFSOpenPolicy::open ( std::string const &  key)

Definition at line 11 of file TKeyVFSOpenPolicy.cc.

References art::errors::FileOpenError, flags_, tfile_, and tkeyvfs_open_v2().

12 {
13  if (!key.size()) {
15  << "Failed to open TKEYVFS DB due to empty key spec.\n";
16  }
17 
18  auto const uriKey = cet::sqlite::assembleNoLockURI(key);
19  sqlite3* db{nullptr};
20  int const rc{tkeyvfs_open_v2(uriKey.c_str(), &db, flags_, tfile_)};
21  if (rc != SQLITE_OK) {
23  << "Failed to open requested DB, \"" << key << "\" of type, \""
24  << "tkeyvfs"
25  << "\" -- " << sqlite3_errmsg(db) << '\n';
26  }
27  return db;
28 }
int tkeyvfs_open_v2(const char *filename, sqlite3 **ppDb, int flags, TFile *rootFile )
Definition: tkeyvfs.cc:1837
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

int art::TKeyVFSOpenPolicy::flags_
private

Definition at line 20 of file TKeyVFSOpenPolicy.h.

Referenced by open(), and TKeyVFSOpenPolicy().

TFile* art::TKeyVFSOpenPolicy::tfile_
private

Definition at line 19 of file TKeyVFSOpenPolicy.h.

Referenced by open().


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