2#include <ossia/detail/string_view.hpp>
11OSSIA_EXPORT std::string& sanitize_device_name(std::string& name);
12OSSIA_EXPORT std::string& sanitize_name(std::string& name);
13OSSIA_EXPORT std::string sanitize_name(
const std::string& s);
14OSSIA_EXPORT std::string sanitize_name(std::string&& s);
15OSSIA_EXPORT std::string sanitize_name(
const char* s);
16OSSIA_EXPORT std::string
17sanitize_name(std::string name_base,
const std::vector<std::string>& brethren);
22template <
typename Char_T>
23bool is_valid_character_for_device(Char_T c)
25 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z') || (c >=
'0' && c <=
'9')
26 || (c ==
'.') || (c ==
'~') || (c ==
'_') || (c ==
'(') || (c ==
')')
27 || (c ==
'-') || (c ==
' ') || (c ==
'=');
32template <
typename Char_T>
33bool is_valid_character_for_name(Char_T c)
35 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z') || (c >=
'0' && c <=
'9')
36 || (c ==
'.') || (c ==
'~') || (c ==
'_') || (c ==
'(') || (c ==
')')
37 || (c ==
'-') || (c ==
':') || (c ==
' ') || (c ==
'=');
43constexpr std::string_view device_characters() noexcept
45 constexpr_return(ossia::make_string_view(
"a-zA-Z0-9_~() .-"));
51constexpr std::string_view name_characters() noexcept
53 constexpr_return(ossia::make_string_view(
"a-zA-Z0-9_~(): .-"));
59constexpr std::string_view path_characters() noexcept
61 constexpr_return(ossia::make_string_view(
"/a-zA-Z0-9_~(): .-"));
64constexpr std::string_view name_characters_no_instance() noexcept
66 constexpr_return(ossia::make_string_view(
"a-zA-Z0-9_~(): -"));
75constexpr std::string_view pattern_match_characters() noexcept
77 constexpr_return(ossia::make_string_view(
"a-zA-Z0-9_~(): .*?,{}\\[\\]-"));
88bool is_brace_expansion(std::string_view);
97OSSIA_EXPORT std::vector<std::string> address_parts(std::string_view src);