File indexing completed on 2026-05-27 07:24:05
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #include "detray/definitions/containers.hpp"
0013
0014
0015 #include <ranges>
0016 #include <string>
0017 #include <string_view>
0018
0019 namespace detray::utils {
0020
0021
0022 struct string_view_concat2 {
0023 std::string_view s1;
0024 std::string_view s2;
0025
0026 explicit operator std::string() const {
0027 return std::string(s1) + std::string(s2);
0028 }
0029 };
0030
0031
0032 inline dvector<std::string> split_at_delim(const std::string &input,
0033 const char delim) {
0034 dvector<std::string> tokens{};
0035
0036 for (const auto char_range : std::views::split(input, delim)) {
0037 std::string s{""};
0038
0039 for (const char c : char_range) {
0040 s.push_back(c);
0041 }
0042 tokens.push_back(std::move(s));
0043 }
0044
0045 return tokens;
0046 }
0047
0048 }