aboutsummaryrefslogtreecommitdiff
path: root/src/utfstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/utfstring.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/utfstring.cpp b/src/utfstring.cpp
index ae5efaf..eb23713 100644
--- a/src/utfstring.cpp
+++ b/src/utfstring.cpp
@@ -1,29 +1,17 @@
1#include "bu/utfstring.h" 1/*
2 2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3template class Bu::FBasicString<short>; 3 *
4 4 * This file is part of the libbu++ library and is released under the
5template<> uint32_t Bu::__calcHashCode<Bu::UtfString>( const Bu::UtfString &k ) 5 * terms of the license contained in the file LICENSE.
6{ 6 */
7 long j, sz = k.getSize()*2;
8 const char *s = (const char *)k.getStr();
9 7
10 long nPos = 0; 8#include "bu/utfstring.h"
11 for( j = 0; j < sz; j++, s++ )
12 {
13 nPos = *s + (nPos << 6) + (nPos << 16) - nPos;
14 }
15
16 return nPos;
17}
18 9
19template<> bool Bu::__cmpHashKeys<Bu::UtfString>( 10Bu::UtfString::UtfString()
20 const Bu::UtfString &a, const Bu::UtfString &b )
21{ 11{
22 return a == b;
23} 12}
24 13
25template<> void Bu::__tracer_format<Bu::UtfString>( const Bu::UtfString &v ) 14Bu::UtfString::~UtfString()
26{ 15{
27 printf("(%ld)\"%s\"", v.getSize(), (const char *)v.getStr() );
28} 16}
29 17