1 /** @file scim_stl_map.h
5 * Smart Common Input Method
7 * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this program; if not, write to the
22 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23 * Boston, MA 02111-1307 USA
25 * $Id: scim_stl_map.h,v 1.1 2005/01/07 15:28:21 suzhe Exp $
28 #ifndef __SCIM_STL_MAP_H
29 #define __SCIM_STL_MAP_H
32 #if defined (HAVE_EXT_HASH_MAP)
33 #define SCIM_USE_STL_EXT_HASH_MAP 1
34 #include <ext/hash_map>
35 #elif defined (HAVE_HASH_MAP)
36 #define SCIM_USE_STL_HASH_MAP 1
41 #if !defined (SCIM_USE_STL_HASH_MAP) && !defined (SCIM_USE_STL_EXT_HASH_MAP)
42 #define SCIM_USE_STL_MAP 1
48 #if SCIM_USE_STL_EXT_HASH_MAP
49 class scim_hash_string {
50 __gnu_cxx::hash <const char *> _h;
52 size_t operator ()(const String &str) const {
53 return _h (str.c_str ());
56 #elif SCIM_USE_STL_HASH_MAP
57 class scim_hash_string {
58 std::hash <const char *> _h;
60 size_t operator ()(const String &str) const {
61 return _h (str.c_str ());
68 #endif //__SCIM_STL_MAP_H
71 vi:ts=4:nowrap:ai:expandtab