LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
string_view_util.cc File Reference
Include dependency graph for string_view_util.cc:

Go to the source code of this file.

Functions

int memcmp (std::string_view const &lhs, std::string_view const &rhs)
 
int strcasecmp (const std::string_view &lhs, const std::string_view &rhs)
 

Detailed Description

Additional handy utilities for string_view and hence also TextView.

Definition in file string_view_util.cc.

Function Documentation

◆ memcmp()

int memcmp ( const std::string_view & lhs,
const std::string_view & rhs )

Compare views with ordering.

Parameters
lhsinput view
rhsinput view
Returns
The ordered comparison value.
  • -1 if lhs is less than rhs
  • 1 if lhs is greater than rhs
  • 0 if the views have identical content.

If one view is the prefix of the other, the shorter view is less (first in the ordering).

Note
For string views, there is no difference between strcmp and memcmp.
See also
strcmp

Definition at line 11 of file string_view_util.cc.

◆ strcasecmp()

int strcasecmp ( const std::string_view & lhs,
const std::string_view & rhs )

Compare views with ordering, ignoring case.

Parameters
lhsinput view
rhsinput view
Returns
The ordered comparison value.
  • -1 if lhs is less than rhs
  • 1 if lhs is greater than rhs
  • 0 if the views have identical content.

If one view is the prefix of the other, the shorter view is less (first in the ordering).

Definition at line 30 of file string_view_util.cc.