#include <FileUtils.h>
Public Member Functions | |
const std::string & | content () const |
FileReader () | |
bool | read (const std::string &fileName) |
virtual | ~FileReader () |
Private Attributes | |
std::string | m_content |
Definition at line 7 of file FileUtils.h.
|
inline |
Definition at line 27 of file FileUtils.h.
|
inlinevirtual |
Definition at line 13 of file FileUtils.h.
|
inline |
Definition at line 31 of file FileUtils.h.
Referenced by cond::XMLAuthenticationService::XMLAuthenticationService::processFile().
bool cond::FileReader::read | ( | const std::string & | fileName | ) |
struct stat st; if (stat(inputFileName.c_str(), &st) < 0){ seal::MessageStream log( this, this->name(),seal::Msg::Verbose ); log << seal::Msg::Error << "File \"" << inputFileName << "" not found." << seal::flush; return false; }
std::vector<char> buf(st.st_size, 0); int fd = open(inputFileName.c_str(), O_RDONLY); if (fd < 0){ seal::MessageStream log( this, this->name(),seal::Msg::Verbose ); log << seal::Msg::Error << "File \"" << inputFileName << "" cannot be open." << seal::flush; close(fd); return false; }
if (read(fd, &buf[0], st.st_size) != st.st_size){ seal::MessageStream log( this, this->name(),seal::Msg::Verbose ); log << seal::Msg::Error << "File \"" << inputFileName << "" cannot be open for reading." << seal::flush; close(fd); return false; } std::string content(&buf[0], &buf[0]+st.st_size);
Definition at line 6 of file FileUtils.cc.
References end, edm::hlt::Exception, recoMuon::in, analyzePatCleaning_cfg::inputFile, m_content, producerFileCleanner::msg, and findQualityFiles::size.
Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), cond::XMLAuthenticationService::XMLAuthenticationService::processFile(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().
|
private |
Definition at line 21 of file FileUtils.h.
Referenced by read().