Graphviz 13.0.0~dev.20250121.0651
|
Non-owning string references. More...
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <util/alloc.h>
#include <util/startswith.h>
#include <util/strcasecmp.h>
Go to the source code of this file.
Data Structures | |
struct | strview_t |
a non-owning string reference More... | |
Functions | |
static strview_t | strview (const char *referent, char terminator) |
create a string reference | |
static char * | strview_str (strview_t source) |
make a heap-allocated string from this string view | |
static bool | strview_case_eq (strview_t a, strview_t b) |
compare two string references for case insensitive equality | |
static bool | strview_case_str_eq (strview_t a, const char *b) |
compare a string reference to a string for case insensitive equality | |
static int | strview_cmp (strview_t a, strview_t b) |
compare two string references | |
static bool | strview_eq (strview_t a, strview_t b) |
compare two string references for equality | |
static bool | strview_str_eq (strview_t a, const char *b) |
compare a string reference to a string for equality | |
static bool | strview_str_contains (strview_t haystack, const char *needle) |
does the given string appear as a substring of the string view? | |
This is similar to C++17’s std::string_view
. Instances of strview_t
should generally be passed around by value rather than pointer as they are small.
Definition in file strview.h.
|
inlinestatic |
Definition at line 26 of file strview.h.
References NULL.
Referenced by comp_entities(), gv_get_ps_fontlist(), gvplugin_install(), gvplugin_list(), gvplugin_load(), gvPluginList(), pic_textspan(), scanEntity(), set_attr_object_type(), split(), strview_case_str_eq(), strview_str_eq(), and update_columns().
Definition at line 49 of file strview.h.
References strview_t::data, NULL, and strview_t::size.
Referenced by gvplugin_list(), gvPluginList(), and strview_case_str_eq().
|
inlinestatic |
Definition at line 62 of file strview.h.
References strview_t::data, NULL, strview(), and strview_case_eq().
Definition at line 71 of file strview.h.
References cmp(), strview_t::data, and strview_t::size.
Referenced by comp_entities(), gvplugin_install(), and strview_eq().
Definition at line 89 of file strview.h.
References strview_t::data, NULL, and strview_cmp().
Referenced by gvplugin_install(), gvplugin_load(), and strview_str_eq().
|
inlinestatic |
Definition at line 41 of file strview.h.
References strview_t::data, gv_strndup(), NULL, and strview_t::size.
Referenced by add_column(), gv_get_ps_fontlist(), gvPluginList(), parseSegs(), and svg_size().
|
inlinestatic |
Definition at line 107 of file strview.h.
References strview_t::data, NULL, offset, strview_t::size, and startswith().
|
inlinestatic |
Definition at line 98 of file strview.h.
References strview_t::data, NULL, strview(), and strview_eq().
Referenced by add_column(), gvplugin_load(), object_type_helper(), onematch(), parseStyle(), picfontname(), prformat(), and svg_size().