GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TGRSIUtilities.h
Go to the documentation of this file.
1#ifndef TGRSIUTILITIES_H
2#define TGRSIUTILITIES_H
3
4#include <fstream>
5#include <string>
6#include <vector>
7
8#include "TGRSITypes.h"
9
10bool FileExists(const char* filename);
11bool DirectoryExists(const char* dirname);
12bool AllFilesExist(const std::vector<std::string>& filenames);
13
14void trim(std::string& line, const std::string& trimChars = " \f\n\r\t\v");
15void trimWS(std::string& line);
16
17int GetRunNumber(const std::string&);
18int GetSubRunNumber(const std::string&);
19
20inline size_t FindFileSize(const char* fname)
21{
22 std::ifstream temp(fname, std::ios::in | std::ios::ate);
23 size_t fsize = temp.tellg();
24 temp.close();
25 return fsize;
26}
27
28#endif
int GetRunNumber(const std::string &)
void trim(std::string &line, const std::string &trimChars=" \f\n\r\t\v")
void trimWS(std::string &line)
bool FileExists(const char *filename)
bool DirectoryExists(const char *dirname)
bool AllFilesExist(const std::vector< std::string > &filenames)
size_t FindFileSize(const char *fname)
int GetSubRunNumber(const std::string &)