mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-07 14:14:10 +08:00
indentation and other formatting changes. also cleaned up
#includes.
This commit is contained in:
@@ -1,30 +1,33 @@
|
||||
#include "CString.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
#include <algorithm>
|
||||
|
||||
//
|
||||
// CStringUtil::CaselessCmp
|
||||
//
|
||||
|
||||
bool CStringUtil::CaselessCmp::cmpEqual(
|
||||
const CString::value_type& a,
|
||||
const CString::value_type& b)
|
||||
bool
|
||||
CStringUtil::CaselessCmp::cmpEqual(
|
||||
const CString::value_type& a,
|
||||
const CString::value_type& b)
|
||||
{
|
||||
// FIXME -- use std::tolower
|
||||
// FIXME -- use std::tolower but not in all versions of libstdc++
|
||||
return tolower(a) == tolower(b);
|
||||
}
|
||||
|
||||
bool CStringUtil::CaselessCmp::cmpLess(
|
||||
const CString::value_type& a,
|
||||
const CString::value_type& b)
|
||||
bool
|
||||
CStringUtil::CaselessCmp::cmpLess(
|
||||
const CString::value_type& a,
|
||||
const CString::value_type& b)
|
||||
{
|
||||
// FIXME -- use std::tolower
|
||||
// FIXME -- use std::tolower but not in all versions of libstdc++
|
||||
return tolower(a) < tolower(b);
|
||||
}
|
||||
|
||||
bool CStringUtil::CaselessCmp::less(
|
||||
const CString& a,
|
||||
const CString& b)
|
||||
bool
|
||||
CStringUtil::CaselessCmp::less(
|
||||
const CString& a,
|
||||
const CString& b)
|
||||
{
|
||||
return std::lexicographical_compare(
|
||||
a.begin(), a.end(),
|
||||
@@ -32,16 +35,18 @@ bool CStringUtil::CaselessCmp::less(
|
||||
&CStringUtil::CaselessCmp::cmpLess);
|
||||
}
|
||||
|
||||
bool CStringUtil::CaselessCmp::equal(
|
||||
const CString& a,
|
||||
const CString& b)
|
||||
bool
|
||||
CStringUtil::CaselessCmp::equal(
|
||||
const CString& a,
|
||||
const CString& b)
|
||||
{
|
||||
return !(less(a, b) || less(b, a));
|
||||
}
|
||||
|
||||
bool CStringUtil::CaselessCmp::operator()(
|
||||
const CString& a,
|
||||
const CString& b) const
|
||||
bool
|
||||
CStringUtil::CaselessCmp::operator()(
|
||||
const CString& a,
|
||||
const CString& b) const
|
||||
{
|
||||
return less(a, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user