File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 2222#include < strings.h>
2323#include < string_view>
2424
25+ #include < boost/algorithm/string/predicate.hpp>
26+
2527using std::ostringstream;
28+ using namespace std ::literals::string_view_literals;
2629
27- bool strict_strtob (const char * str, std::string *err)
30+ bool strict_strtob (std::string_view str, std::string *err)
2831{
29- if (strcasecmp (str, " false" ) == 0 ) {
32+ if (boost::iequals (str, " false" sv) ) {
3033 return false ;
31- } else if (strcasecmp (str, " true" ) == 0 ) {
34+ } else if (boost::iequals (str, " true" sv) ) {
3235 return true ;
3336 } else {
3437 int b = strict_strtol (str, 10 , err);
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ auto consume(std::string_view& s, int base = 10)
6969}
7070} // namespace ceph
7171
72- bool strict_strtob (const char * str, std::string *err);
72+ bool strict_strtob (std::string_view str, std::string *err);
7373
7474long long strict_strtoll (std::string_view str, int base, std::string *err);
7575
You can’t perform that action at this time.
0 commit comments