Flutter Engine
The Flutter Engine
Functions
skstd Namespace Reference

Functions

constexpr bool starts_with (std::string_view str, std::string_view prefix)
 
constexpr bool starts_with (std::string_view str, std::string_view::value_type c)
 
constexpr bool ends_with (std::string_view str, std::string_view suffix)
 
constexpr bool ends_with (std::string_view str, std::string_view::value_type c)
 
constexpr bool contains (std::string_view str, std::string_view needle)
 
constexpr bool contains (std::string_view str, std::string_view::value_type c)
 
std::string to_string (float value)
 
std::string to_string (double value)
 

Function Documentation

◆ contains() [1/2]

constexpr bool skstd::contains ( std::string_view  str,
std::string_view  needle 
)
inlineconstexpr

Definition at line 41 of file SkStringView.h.

41 {
42 return str.find(needle) != std::string_view::npos;
43}

◆ contains() [2/2]

constexpr bool skstd::contains ( std::string_view  str,
std::string_view::value_type  c 
)
inlineconstexpr

Definition at line 45 of file SkStringView.h.

45 {
46 return str.find(c) != std::string_view::npos;
47}

◆ ends_with() [1/2]

constexpr bool skstd::ends_with ( std::string_view  str,
std::string_view  suffix 
)
inlineconstexpr

Definition at line 28 of file SkStringView.h.

28 {
29 if (suffix.length() > str.length()) {
30 return false;
31 }
32 return suffix.length() == 0 || !memcmp(str.data() + str.length() - suffix.length(),
33 suffix.data(), suffix.length());
34}

◆ ends_with() [2/2]

constexpr bool skstd::ends_with ( std::string_view  str,
std::string_view::value_type  c 
)
inlineconstexpr

Definition at line 36 of file SkStringView.h.

36 {
37 return !str.empty() && str.back() == c;
38}

◆ starts_with() [1/2]

constexpr bool skstd::starts_with ( std::string_view  str,
std::string_view  prefix 
)
inlineconstexpr

Definition at line 17 of file SkStringView.h.

17 {
18 if (prefix.length() > str.length()) {
19 return false;
20 }
21 return prefix.length() == 0 || !memcmp(str.data(), prefix.data(), prefix.length());
22}

◆ starts_with() [2/2]

constexpr bool skstd::starts_with ( std::string_view  str,
std::string_view::value_type  c 
)
inlineconstexpr

Definition at line 24 of file SkStringView.h.

24 {
25 return !str.empty() && str.front() == c;
26}

◆ to_string() [1/2]

std::string skstd::to_string ( double  value)

Definition at line 54 of file SkSLString.cpp.

54 {
55 return to_string_impl<double, 17>(value);
56}
uint8_t value

◆ to_string() [2/2]

std::string skstd::to_string ( float  value)

Definition at line 50 of file SkSLString.cpp.

50 {
51 return to_string_impl<float, 9>(value);
52}