CbmRoot
Loading...
Searching...
No Matches
EnumDict.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#include "EnumDict.h"
5
6#include <sstream>
7
8void cbm::algo::detail::RaiseUnknownEntry(std::string_view str, const std::vector<std::string_view>& validEntries)
9{
10 std::ostringstream oss;
11 oss << "Could not parse '" << str << "'. Valid entries are: ";
12
13 for (size_t i = 0; i < validEntries.size(); ++i) {
14 oss << validEntries[i];
15 if (i != validEntries.size() - 1) {
16 oss << ", ";
17 }
18 }
19 throw std::invalid_argument(oss.str());
20}
void RaiseUnknownEntry(std::string_view str, const std::vector< std::string_view > &validEntries)
Definition EnumDict.cxx:8