ATLAS Offline Software
Loading...
Searching...
No Matches
Control/CxxUtils/CxxUtils/StringUtils.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6#ifndef CXXUTILS_STRINGUTILS_H
7#define CXXUTILS_STRINGUTILS_H
8
9#include <string>
10#include <string_view>
11#include <vector>
12#include <iostream>
13
14
15namespace CxxUtils {
19
21 int atoi(std::string_view str);
23 double atof(std::string_view str);
25 std::string_view eraseWhiteSpaces(std::string_view str);
26
28 std::vector<std::string> tokenize(const std::string& the_str,
29 std::string_view delimiters);
30
31 std::vector<double> tokenizeDouble(const std::string& the_str,
32 std::string_view delimiter);
33
34 std::vector<int> tokenizeInt(const std::string& the_str,
35 std::string_view delimiter);
36
37
38}
39#endif
std::vector< int > tokenizeInt(const std::string &the_str, std::string_view delimiter)
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
double atof(std::string_view str)
Converts a string into a double / float.
std::vector< double > tokenizeDouble(const std::string &the_str, std::string_view delimiter)
std::string_view eraseWhiteSpaces(std::string_view str)
Removes all trailing and starting whitespaces from a string.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...