summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-01-28 14:31:47 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-01-28 14:31:47 +0000
commitf50adf12764f4d21931cb5c0f76dc6923ee28630 (patch)
treeba0eef0116b90b2fa1fe1ec48e27e43a30cc7ccc /i18nutil
parent5c49ea07e7d0c2bb01693db5c28fba7e1c000cda (diff)
INTEGRATION: CWS i18n39 (1.3.38); FILE MERGED
2007/12/12 22:42:03 khong 1.3.38.1: #i81366# add new Japanese transliterations
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/inc/i18nutil/oneToOneMapping.hxx66
-rw-r--r--i18nutil/inc/i18nutil/widthfolding.hxx15
2 files changed, 64 insertions, 17 deletions
diff --git a/i18nutil/inc/i18nutil/oneToOneMapping.hxx b/i18nutil/inc/i18nutil/oneToOneMapping.hxx
index 72fbf6cfca51..326d198b66a1 100644
--- a/i18nutil/inc/i18nutil/oneToOneMapping.hxx
+++ b/i18nutil/inc/i18nutil/oneToOneMapping.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: oneToOneMapping.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: rt $ $Date: 2005-09-07 17:39:08 $
+ * last change: $Author: vg $ $Date: 2008-01-28 15:31:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -40,29 +40,67 @@
namespace com { namespace sun { namespace star { namespace i18n {
+class widthfolding;
+
typedef std::pair< sal_Unicode, sal_Unicode > OneToOneMappingTable_t;
#define MAKE_PAIR(item1,item2) std::make_pair< sal_Unicode, sal_Unicode >((sal_Unicode)item1,(sal_Unicode)item2)
+typedef sal_Int8 UnicodePairFlag;
+typedef struct _UnicodePairWithFlag
+{
+ sal_Unicode first;
+ sal_Unicode second;
+ UnicodePairFlag flag;
+} UnicodePairWithFlag;
+
class oneToOneMapping
{
+private:
+ // no copy, no substitution
+ oneToOneMapping( const oneToOneMapping& );
+ oneToOneMapping& operator=( const oneToOneMapping& );
public:
- oneToOneMapping(OneToOneMappingTable_t *_table, const size_t _bytes);
- ~oneToOneMapping();
+ oneToOneMapping( OneToOneMappingTable_t *rpTable, const size_t rnSize, const size_t rnUnitSize = sizeof(OneToOneMappingTable_t) );
+ virtual ~oneToOneMapping();
+
+ // make index for fast search
+ // bluedawrf: not used
+// void makeIndex();
+
+ // binary search
+ virtual sal_Unicode find( const sal_Unicode nKey ) const;
+
+ // translator
+ sal_Unicode operator[] ( const sal_Unicode nKey ) const { return find( nKey ); };
- // make index for fast search
- void makeIndex();
- // binary search / idex search
- sal_Unicode find(const sal_Unicode key) const;
+protected:
+ OneToOneMappingTable_t *mpTable;
+ size_t mnSize;
+};
+
+class oneToOneMappingWithFlag : public oneToOneMapping
+{
+ friend class widthfolding;
+
+private:
+ // no copy, no substitution
+ oneToOneMappingWithFlag( const oneToOneMappingWithFlag& );
+ oneToOneMappingWithFlag& operator=( const oneToOneMappingWithFlag& );
+public:
+ oneToOneMappingWithFlag( UnicodePairWithFlag *rpTableWF, const size_t rnSize, const UnicodePairFlag rnFlag );
+ virtual ~oneToOneMappingWithFlag();
- // translator
- sal_Unicode operator[] (const sal_Unicode key) const { return find (key); };
+ // make index for fast search
+ void makeIndex();
+ // index search
+ virtual sal_Unicode find( const sal_Unicode nKey ) const;
protected:
- OneToOneMappingTable_t *table;
- size_t max_size;
- int *index[256];
- sal_Bool hasIndex;
+ UnicodePairWithFlag *mpTableWF;
+ UnicodePairFlag mnFlag;
+ UnicodePairWithFlag **mpIndex[256];
+ sal_Bool mbHasIndex;
};
} } } }
diff --git a/i18nutil/inc/i18nutil/widthfolding.hxx b/i18nutil/inc/i18nutil/widthfolding.hxx
index 078de073d4dc..bd84c8dffea1 100644
--- a/i18nutil/inc/i18nutil/widthfolding.hxx
+++ b/i18nutil/inc/i18nutil/widthfolding.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: widthfolding.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: rt $ $Date: 2005-09-07 17:39:49 $
+ * last change: $Author: vg $ $Date: 2008-01-28 15:31:47 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -41,14 +41,23 @@
namespace com { namespace sun { namespace star { namespace i18n {
+#define WIDTHFOLDNIG_DONT_USE_COMBINED_VU 0x01
+
class widthfolding
{
public:
static oneToOneMapping& getfull2halfTable();
static oneToOneMapping& gethalf2fullTable();
+
+ static oneToOneMapping& getfull2halfTableForASC();
+ static oneToOneMapping& gethalf2fullTableForJIS();
+
+ static oneToOneMapping& getfullKana2halfKanaTable();
+ static oneToOneMapping& gethalfKana2fullKanaTable();
+
static rtl::OUString decompose_ja_voiced_sound_marks(const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset);
static sal_Unicode decompose_ja_voiced_sound_marksChar2Char (sal_Unicode inChar);
- static rtl::OUString compose_ja_voiced_sound_marks(const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset);
+ static rtl::OUString compose_ja_voiced_sound_marks(const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset, sal_Int32 nFlags = 0 );
static sal_Unicode getCompositionChar(sal_Unicode c1, sal_Unicode c2);
};