Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
StdString.h
1/*
2 * Hal::StdString.h
3 *
4 * Created on: 30-04-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HALSTDSTRING_H_
10#define HALSTDSTRING_H_
11
12#include <TString.h>
13
14namespace Hal {
15 namespace Std {
21 TString RemoveUnits(TString string);
27 TString GetUnits(TString string);
35 std::vector<TString> ExplodeString(TString string, Char_t delimiter, Bool_t keepEmpty = kFALSE);
44 std::vector<std::pair<TString, TString>> ConvertMainArgs(int argc, char* argv[]);
52 void ReplaceInFile(TString path, TString newPath, TString oldPattern, TString newPattern);
53
61 void ReplaceInFile(TString path,
62 TString newPath,
63 std::initializer_list<TString> oldPattern,
64 std::initializer_list<TString> newPattern);
77 TString RoundToString(Double_t value, Int_t precission = 0, Option_t* opt = "");
87 TString RoundToString(Int_t value, Int_t precission = 0, Option_t* opt = "");
97 TString RoundToString(UInt_t value, Int_t precission = 0, Option_t* opt = "");
107 TString RoundToString(ULong_t value, Int_t precission = 0, Option_t* opt = "");
117 TString RoundToString(ULong64_t value, Int_t precission = 0, Option_t* opt = "");
124 TString RemoveString(TString text, TString pattern);
132 TString RemoveNChars(TString str, Int_t n, Char_t opt = 'b');
139 std::vector<TString> GetLinesFromFile(TString file, Bool_t skipEmpty = kTRUE);
148 std::vector<TString> FindBrackets(TString& option, Bool_t remove = kFALSE, Bool_t skipEmpty = kTRUE);
160 Bool_t FindParam(TString& option, TString pattern, Bool_t remove = kFALSE);
168 Int_t FindParam2(TString& option, TString pattern, Bool_t remove = kFALSE);
176 Bool_t FindExpressionSingleValue(TString& expression, Int_t& val, Bool_t remove);
185 Bool_t FindExpressionTwoValues(TString& expression, Int_t& val1, Int_t& val2, Bool_t remove);
193 Bool_t FindExpressionTwoFloats(TString& expression, Double_t& val1, Double_t& val2, Bool_t remove);
194 } // namespace Std
195} // namespace Hal
196#endif /* HALSTDSTRING_H_ */