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