#ifndef __JSUPPORT__JFILENAMESUPPORTTOOLKIT__ #define __JSUPPORT__JFILENAMESUPPORTTOOLKIT__ #include #include "Jeep/JeepToolkit.hh" /** * \file * Specifications of file name extensions. * \author mdejong */ namespace JSUPPORT {} namespace JPP { using namespace JSUPPORT; } namespace JSUPPORT { using JEEP::getFilenameExtension; static const char* const ROOT_FILE_FORMAT = "root"; //!< file name extension ROOT format static const char* const JSON_FILE_FORMAT = "json"; //!< file name extension JSON format static const char* const DAQ_FILE_FORMAT = "dat"; //!< file name extension DAQ binary format static const char* const MONTE_CARLO_FILE_FORMAT = "evt"; //!< file name extension ASCII format static const char* const GZIP_FILE_FORMAT = "gz"; //!< file name extension gzip format static const char* const ASCII_FILE_FORMAT = "txt"; //!< file name extension ASCII format static const char* const FILE_LIST_FORMAT = "files"; //!< file name extension ASCII format with list of file names /** * Check file format. * * \return true if ROOT format; else false */ inline bool isROOTFile(const char* file_name) { return getFilenameExtension(file_name) == ROOT_FILE_FORMAT; } /** * Check file format. * * \return true if ROOT format; else false */ inline bool isJSONFile(const char* file_name) { return getFilenameExtension(file_name) == JSON_FILE_FORMAT; } /** * Check file format. * * \return true if DAQ format; else false */ inline bool isDAQFile(const char* file_name) { return getFilenameExtension(file_name) == DAQ_FILE_FORMAT; } /** * Check file format. * * \return true if MONTE CARLO format; else false */ inline bool isMonteCarloFile(const char* file_name) { return getFilenameExtension(file_name) == MONTE_CARLO_FILE_FORMAT; } /** * Check file format. * * \return true if gzip format; else false */ inline bool isGzipFile(const char* file_name) { return getFilenameExtension(file_name) == GZIP_FILE_FORMAT; } } #endif