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