-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathutil.h
45 lines (34 loc) · 1.27 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Author jblomer@cern.ch
*/
#ifndef UTIL_H_
#define UTIL_H_
#include <stdint.h>
#include <string>
#include <vector>
class TFile;
enum class FileFormats
{ kRoot, kH5Row, kH5Column, kAvroDeflated, kAvroInflated,
kSqlite, kProtobufDeflated, kProtobufInflated, kProtobufDeepInflated,
kRootInflated, kRootDeflated, kRootLz4, kRootLzma, kRootRow,
kRootAutosplitInflated, kRootAutosplitDeflated, kRootDeepsplitInflated,
kRootDeepsplitDeflated, kRootDeepsplitLz4, kParquetInflated,
kParquetDeflated, kParquetSnappy, kParquetDeepInflated,
kNtuple, kNtupleDeflated, kNtupleInflated };
FileFormats GetFileFormat(const std::string &suffix);
std::string StripSuffix(const std::string &path);
std::string GetSuffix(const std::string &path);
std::string GetFileName(const std::string &path);
std::string GetParentPath(const std::string &path);
std::vector<std::string> SplitString(
const std::string &str,
const char delim,
const unsigned max_chunks = 0);
std::string JoinStrings(
const std::vector<std::string> &strings,
const std::string &joint);
uint64_t String2Uint64(const std::string &value);
std::string StringifyUint(const uint64_t value);
int GetCompressionSettings(std::string shorthand);
TFile *OpenOrDownload(const std::string &path);
#endif // UTIL_H_