aboutsummaryrefslogtreecommitdiff
path: root/src/utfstring.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/utfstring.cpp
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to 'src/utfstring.cpp')
-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