blob: f1ddd2c36e5d4be812a16ada64f667f8021d68e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
* Copyright (C) 2007 Xagasoft, All rights reserved.
*
* This file is part of the libbu++ library and is released under the
* terms of the license contained in the file LICENSE.
*/
#include "fstring.h"
#include "hash.h"
template<> uint32_t Bu::__calcHashCode<Bu::FString>( const Bu::FString &k )
{
long j, sz = k.getSize();
const char *s = k.getStr();
long nPos = 0;
for( j = 0; j < sz; j++, s++ )
{
nPos = *s + (nPos << 6) + (nPos << 16) - nPos;
}
return nPos;
}
template<> bool Bu::__cmpHashKeys<Bu::FString>(
const Bu::FString &a, const Bu::FString &b )
{
return a == b;
}
std::basic_ostream<char>& operator<< (std::basic_ostream<char> &os, const Bu::FString &val )
{
os.write( val.getStr(), val.getSize() );
return os;
}
|