36 using codeAndRepr = std::pair<const char *, const char *>;
37 constexpr static std::array<codeAndRepr, 4> forbiddenChars{codeAndRepr{
"\u002E",
"."}, codeAndRepr{
"\u002F",
"/"},
38 codeAndRepr{
"\u0020",
"space"},
39 codeAndRepr{
"\u005C",
"\\"}};
41 for (
auto &&[code, repr] : forbiddenChars) {
42 if (
name.find(code) != std::string_view::npos)
43 return R__FAIL(std::string(where) +
" name '" + std::string(
name) +
"' cannot contain character '" + repr +
47 if (std::count_if(
name.begin(),
name.end(), [](
unsigned char c) { return std::iscntrl(c); }))
48 return R__FAIL(std::string(where) +
" name '" + std::string(
name) +
49 "' cannot contain character classified as control character. These notably include newline, tab, "
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
A log configuration for a channel, e.g.
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
RResult< void > EnsureValidNameForRNTuple(std::string_view name, std::string_view where)
Check whether a given string is a valid name according to the RNTuple specification.
RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.