![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <string>#include <string_view>#include <type_traits>#include <utility>#include <stdlib.h>#include <ctype.h>

Go to the source code of this file.
Functions | |
| template<typename T , std::enable_if_t<!from_chars_available_v< T >, bool > = true, std::enable_if_t< std::is_same_v< T, double >, bool > = true> | |
| bool | parse_num (std::string_view sv, T &res) |
| template<typename T , std::enable_if_t<!from_chars_available_v< T >, bool > = true, std::enable_if_t< std::is_integral_v< T >, bool > = true> | |
| bool | parse_num (std::string_view sv, T &res, int base=10) |
| template<typename T , auto convert, typename... Args> | |
| bool | parse_num_fallback_impl (std::string_view sv, T &res, Args... args) |
| bool | sv_contains (std::string_view haystack, std::string_view needle) |
| bool | sv_is_prefix (std::string_view haystack, std::string_view needle) |
| std::string_view | sv_trim_whitespace (std::string_view sv) |
| std::string_view | sv_trim_whitespace_back (std::string_view sv) |
| std::string_view | sv_trim_whitespace_front (std::string_view sv) |
| std::string_view | tokenize (std::string_view &str, char delim, char quot='\0') |
| Tokenizer for string_view. | |
Variables | |
| template<typename T > | |
| constexpr bool | from_chars_available_v = false |
Definition in file string_view_utils.hpp.
| bool parse_num | ( | std::string_view | sv, |
| T & | res ) |
Definition at line 164 of file string_view_utils.hpp.
References parse_num_fallback_impl().

| bool parse_num | ( | std::string_view | sv, |
| T & | res, | ||
| int | base = 10 ) |
Definition at line 157 of file string_view_utils.hpp.
References parse_num_fallback_impl().
Referenced by audio_cap_pipewire_init(), audio_play_pw_init(), display_conference_init(), display_conference_worker(), display_drm_init(), display_unix_sock_init(), init(), parse_cfg(), parse_holepunch_conf(), parse_log_cfg(), BandwidthWidget::parseLine(), RecvLossWidget::parseLine(), VuMeterWidget::parseLine(), and AvailableSettings::parseStateVersion().

| bool parse_num_fallback_impl | ( | std::string_view | sv, |
| T & | res, | ||
| Args... | args ) |
Definition at line 136 of file string_view_utils.hpp.
References convert.
Referenced by parse_num(), and parse_num().
|
inline |
Definition at line 68 of file string_view_utils.hpp.
Referenced by parse_log_cfg().
|
inline |
Definition at line 72 of file string_view_utils.hpp.
Referenced by BandwidthWidget::parseLine(), RecvLossWidget::parseLine(), RecvReportWidget::parseLine(), VuMeterWidget::parseLine(), AvailableSettings::parseStateVersion(), AvailableSettings::queryLine(), and AvailableSettings::queryProcessLine().
|
inline |
Definition at line 90 of file string_view_utils.hpp.
References sv_trim_whitespace_back(), and sv_trim_whitespace_front().
Referenced by AvailableSettings::queryProcessLine().

|
inline |
Definition at line 83 of file string_view_utils.hpp.
Referenced by sv_trim_whitespace().
|
inline |
Definition at line 76 of file string_view_utils.hpp.
Referenced by sv_trim_whitespace().
| std::string_view tokenize | ( | std::string_view & | str, |
| char | delim, | ||
| char | quot = '\0' ) |
Tokenizer for string_view.
Useful for non-destructive tokenization of strings. Skips empty tokens. str is modified to view the not yet processed remainder.
Typical usage (prints lines "Hello", "World", "!"):
The 'quot' param allows for a basic quotation based deilimiter escape, however the whole token must be escaped. i.e. sync:"opts=a=1:b=2":fs is fine, but sync:opts="a=1:b=2":fs is not.
Definition at line 3 of file string_view_utils.cpp.
Referenced by audio_frame2_resampler::audio_frame2_resampler(), image_pattern_diagonal::image_pattern_diagonal(), image_pattern_text::image_pattern_text(), audio_cap_pipewire_init(), audio_init(), audio_play_pw_init(), display_conference_init(), display_conference_worker(), display_drm_init(), display_multiplier_init(), display_pw_init(), display_unix_sock_init(), Filter_chain::emplace_new(), init(), parse_cfg(), parse_cfg(), parse_holepunch_conf(), BandwidthWidget::parseLine(), RecvLossWidget::parseLine(), VuMeterWidget::parseLine(), print_capabilities(), and AvailableSettings::queryProcessLine().
|
inlineconstexpr |
Definition at line 131 of file string_view_utils.hpp.