~ubuntu-branches/ubuntu/raring/clucene-core/raring-proposed

« back to all changes in this revision

Viewing changes to src/CLucene/util/StringIntern.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-08-11 09:33:38 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120811093338-fgrx41ftqew3qt6a
Tags: 2.3.3.4-1
* New upstream release (Closes: #661703).
* Convert package to multiarch.
* Drop obsolete patches:
  - 01_add_missing_include_bug505667.diff
  - 02_posixness_fix_bug530308.diff
* Add patches:
  - Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
  - Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
  - Install-contribs-lib.patch
  - multiarch.patch
* Update debian/compat: bump to 8.
* Update debian/control:
  - update build dependencies (add cmake, libboost-dev and libz-dev).
  - bump Standards-Version to 3.9.3.
  - rename packages due to ABI bump: libclucene0ldbl -> libclucene-core1.
  - add libclucene-contribs1 package.
* Update debian/rules:
  - rewrite to use CMake.
  - add multiarch support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*------------------------------------------------------------------------------
2
 
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
3
 
4
 
* Distributable under the terms of either the Apache License (Version 2.0) or 
5
 
* the GNU Lesser General Public License, as specified in the COPYING file.
6
 
------------------------------------------------------------------------------*/
7
 
#ifndef _lucene_util_StringIntern_H
8
 
#define _lucene_util_StringIntern_H
9
 
 
10
 
#if defined(_LUCENE_PRAGMA_ONCE)
11
 
# pragma once
12
 
#endif
13
 
 
14
 
#include "VoidMap.h"
15
 
CL_NS_DEF(util)
16
 
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;
17
 
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;
18
 
 
19
 
  /** Functions for intern'ing strings. This
20
 
  * is a process of pooling strings thus using less memory,
21
 
  * and furthermore allows intern'd strings to be directly
22
 
  * compared:
23
 
  * string1==string2, rather than _tcscmp(string1,string2)
24
 
  */
25
 
  class CLStringIntern{
26
 
          static __wcsintrntype stringPool;
27
 
          static __strintrntype stringaPool;
28
 
          STATIC_DEFINE_MUTEX(THIS_LOCK)
29
 
  public:
30
 
        /** 
31
 
        * Internalise the specified string.
32
 
        * \return Returns a pointer to the internalised string
33
 
        */
34
 
        static const char* internA(const char* str CL_FILELINEPARAM);
35
 
        /** 
36
 
        * Uninternalise the specified string. Decreases
37
 
        * the reference count and frees the string if 
38
 
        * reference count is zero
39
 
        * \returns true if string was destroyed, otherwise false
40
 
        */
41
 
        static bool uninternA(const char* str);
42
 
 
43
 
        /** 
44
 
        * Internalise the specified string.
45
 
        * \return Returns a pointer to the internalised string
46
 
        */
47
 
        static const TCHAR* intern(const TCHAR* str CL_FILELINEPARAM);
48
 
        
49
 
        /** 
50
 
        * Uninternalise the specified string. Decreases
51
 
        * the reference count and frees the string if 
52
 
        * reference count is zero
53
 
        * \returns true if string was destroyed, otherwise false
54
 
        */
55
 
        static bool unintern(const TCHAR* str);
56
 
 
57
 
    static void shutdown();
58
 
  };
59
 
 
60
 
CL_NS_END
61
 
#endif