michael@0: /* michael@0: * Copyright (c) 1999 michael@0: * Silicon Graphics Computer Systems, Inc. michael@0: * michael@0: * Copyright (c) 1999 michael@0: * Boris Fomitchev michael@0: * michael@0: * This material is provided "as is", with absolutely no warranty expressed michael@0: * or implied. Any use is at your own risk. michael@0: * michael@0: * Permission to use or copy this software for any purpose is hereby granted michael@0: * without fee, provided the above notices are retained on all copies. michael@0: * Permission to modify the code and to distribute modified code is granted, michael@0: * provided the above notices are retained, and a notice that the code was michael@0: * modified is included with the above copyright notice. michael@0: * michael@0: */ michael@0: #include "stlport_prefix.h" michael@0: michael@0: #include michael@0: michael@0: _STLP_BEGIN_NAMESPACE michael@0: michael@0: // collate michael@0: michael@0: collate::~collate() {} michael@0: michael@0: int collate::do_compare(const char* low1, const char* high1, michael@0: const char* low2, const char* high2) const michael@0: { return _STLP_PRIV __lexicographical_compare_3way(low1, high1, low2, high2); } michael@0: michael@0: string collate::do_transform(const char* low, const char* high) const michael@0: { return string(low, high); } michael@0: michael@0: long collate::do_hash(const char* low, const char* high) const { michael@0: unsigned long result = 0; michael@0: for ( ; low < high; ++low) michael@0: result = 5 * result + *low; michael@0: return result; michael@0: } michael@0: michael@0: #if !defined (_STLP_NO_WCHAR_T) michael@0: // collate michael@0: michael@0: collate::~collate() {} michael@0: michael@0: int michael@0: collate::do_compare(const wchar_t* low1, const wchar_t* high1, michael@0: const wchar_t* low2, const wchar_t* high2) const michael@0: { return _STLP_PRIV __lexicographical_compare_3way(low1, high1, low2, high2); } michael@0: michael@0: wstring collate::do_transform(const wchar_t* low, const wchar_t* high) const michael@0: { return wstring(low, high); } michael@0: michael@0: long collate::do_hash(const wchar_t* low, const wchar_t* high) const { michael@0: unsigned long result = 0; michael@0: for ( ; low < high; ++low) michael@0: result = 5 * result + *low; michael@0: return result; michael@0: } michael@0: #endif michael@0: michael@0: _STLP_END_NAMESPACE michael@0: michael@0: michael@0: // Local Variables: michael@0: // mode:C++ michael@0: // End: michael@0: