Example #1
0
 static inline bool endswith(
     const std::basic_string<_CharT, _Traits, _Alloc> &a,
     const std::basic_string<_CharT, _Traits, _Alloc> &b) {
   typedef std::basic_string<_CharT, _Traits, _Alloc> str_t;
   if (b.size() > a.size()) return false;
   return a.compare(a.size() - b.size(), b.size(), b) == 0;
 }
inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
{ 
   if(0 == *p)
   {
      if(s.empty() || ((s.size() == 1) && (s[0] == 0)))
         return 0;
   }
   return s.compare(p); 
}
Example #3
0
bool EndsWith(const std::basic_string<CharT> &lhs, const std::basic_string<CharT> &rhs)
{
    if (rhs.empty())
        return true;

    if (lhs.length() < rhs.length())
        return false;

    return lhs.compare(lhs.length() - rhs.length(), rhs.length(), rhs) == 0;
}
Example #4
0
inline bool operator > (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
                 const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) > 0; }
Example #5
0
bool operator==(const std::basic_string<CharT, Traits, Alloc> &lhs,
                const std::basic_string<CharT, Traits, Alloc> &rhs)
{
    return (lhs.compare(rhs) == 0);
}