LibreOffice Module i18npool (master) 1
transliteration_OneToOne.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
22
23namespace i18nutil { class oneToOneMapping; }
24
25namespace i18npool {
26
28
30{
31public:
32 OUString
33 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
34
35 sal_Unicode SAL_CALL
36 transliterateChar2Char( sal_Unicode inChar) override;
37
38 // Methods which are shared.
39 sal_Int16 SAL_CALL getType() override;
40
41 OUString
42 foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
43
44 sal_Bool SAL_CALL
45 equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
46 const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
47
48 css::uno::Sequence< OUString > SAL_CALL
49 transliterateRange( const OUString& str1, const OUString& str2 ) override;
50
51protected:
53 i18nutil::oneToOneMapping *table;
54};
55
56#define TRANSLITERATION_ONETOONE( name ) \
57class name final : public transliteration_OneToOne \
58{ \
59public: \
60 name (); \
61 OUString \
62 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) \
63 override; \
64 sal_Unicode SAL_CALL \
65 transliterateChar2Char( sal_Unicode inChar) \
66 override; \
67};
68
69TRANSLITERATION_ONETOONE( fullwidthToHalfwidth )
70TRANSLITERATION_ONETOONE( FULLWIDTHKATAKANA_HALFWIDTHKATAKANA )
71TRANSLITERATION_ONETOONE( FULLWIDTH_HALFWIDTH_LIKE_ASC )
72
74{
75public:
77 OUString
78 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
79};
81{
82public:
84 OUString
85 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
86};
88{
89public:
91 OUString
92 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
93};
94
95#undef TRANSLITERATION_ONETOONE
96
97#define TRANSLITERATION_ONETOONE( name ) \
98class name final : public transliteration_OneToOne \
99{ \
100public: \
101 name (); \
102};
103
104TRANSLITERATION_ONETOONE(hiraganaToKatakana)
105TRANSLITERATION_ONETOONE(katakanaToHiragana)
106TRANSLITERATION_ONETOONE(largeToSmall_ja_JP)
107TRANSLITERATION_ONETOONE(smallToLarge_ja_JP)
108
109#undef TRANSLITERATION_ONETOONE
110
111}
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString transliterateImpl(const OUString &inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
OUString transliterateImpl(const OUString &inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
sal_Bool SAL_CALL equals(const OUString &str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32 &nMatch1, const OUString &str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32 &nMatch2) override
css::uno::Sequence< OUString > SAL_CALL transliterateRange(const OUString &str1, const OUString &str2) override
OUString foldingImpl(const OUString &inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
sal_Unicode SAL_CALL transliterateChar2Char(sal_Unicode inChar) override
OUString transliterateImpl(const OUString &inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
int nCount
Constant values shared between i18npool and, for example, the number formatter.
sal_Unicode(* TransFunc)(const sal_Unicode)
#define TRANSLITERATION_ONETOONE(name)
unsigned char sal_Bool
sal_uInt16 sal_Unicode