23 #if !defined (octave_caseless_str_h)
24 #define octave_caseless_str_h 1
44 std::string::operator = (pname);
48 operator std::string (
void)
const {
return *
this; }
52 const_iterator p1 = begin ();
53 const_iterator p2 = s.begin ();
55 while (p1 != end () && p2 != s.end ())
57 char lp1 = std::tolower (*p1);
58 char lp2 = std::tolower (*p2);
69 if (
length () >= s.length ())
76 bool compare (
const std::string& s,
size_t limit = std::string::npos)
const
78 const_iterator p1 = begin ();
79 const_iterator p2 = s.begin ();
83 while (p1 != end () && p2 != s.end () && k++ < limit)
85 if (std::tolower (*p1) != std::tolower (*p2))
92 return (limit == std::string::npos) ?
size () == s.size () : k == limit;
caseless_str(const char *s)
bool operator<(const std::string &s) const
caseless_str(const caseless_str &name)
std::string::const_iterator const_iterator
caseless_str & operator=(const caseless_str &pname)
size_t size(T const (&)[z])
bool compare(const std::string &s, size_t limit=std::string::npos) const
std::string::iterator iterator
caseless_str(const std::string &s)