CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_util_StringIntern_H 00008 #define _lucene_util_StringIntern_H 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "VoidMap.h" 00015 CL_NS_DEF(util) 00016 typedef CL_NS(util)::CLHashMap<const TCHAR*,int,CL_NS(util)::Compare::TChar,CL_NS(util)::Equals::TChar,CL_NS(util)::Deletor::tcArray, CL_NS(util)::Deletor::DummyInt32 > __wcsintrntype; 00017 typedef CL_NS(util)::CLHashMap<const char*,int,CL_NS(util)::Compare::Char,CL_NS(util)::Equals::Char,CL_NS(util)::Deletor::acArray, CL_NS(util)::Deletor::DummyInt32 > __strintrntype; 00018 00025 class CLStringIntern{ 00026 static __wcsintrntype stringPool; 00027 static __strintrntype stringaPool; 00028 STATIC_DEFINE_MUTEX(THIS_LOCK) 00029 public: 00034 static const char* internA(const char* str CL_FILELINEPARAM); 00041 static bool uninternA(const char* str); 00042 00047 static const TCHAR* intern(const TCHAR* str CL_FILELINEPARAM); 00048 00055 static bool unintern(const TCHAR* str); 00056 00057 static void shutdown(); 00058 }; 00059 00060 CL_NS_END 00061 #endif