Fix a forgotten return of the value
[LibreOffice.git] / i18npool / inc / transliteration_OneToOne.hxx
blob957abcf84de208158a80949902f4246b5fbe4be8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_I18NPOOL_INC_TRANSLITERATION_ONETOONE_HXX
20 #define INCLUDED_I18NPOOL_INC_TRANSLITERATION_ONETOONE_HXX
22 #include "transliteration_commonclass.hxx"
24 namespace i18nutil { class oneToOneMapping; }
26 namespace i18npool {
28 typedef sal_Unicode (*TransFunc)(const sal_Unicode);
30 class transliteration_OneToOne : public transliteration_commonclass
32 public:
33 OUString
34 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
36 sal_Unicode SAL_CALL
37 transliterateChar2Char( sal_Unicode inChar) override;
39 // Methods which are shared.
40 sal_Int16 SAL_CALL getType() override;
42 OUString
43 foldingImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
45 sal_Bool SAL_CALL
46 equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
47 const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
49 css::uno::Sequence< OUString > SAL_CALL
50 transliterateRange( const OUString& str1, const OUString& str2 ) override;
52 protected:
53 TransFunc func;
54 i18nutil::oneToOneMapping *table;
57 #define TRANSLITERATION_ONETOONE( name ) \
58 class name final : public transliteration_OneToOne \
59 { \
60 public: \
61 name (); \
62 OUString \
63 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) \
64 override; \
65 sal_Unicode SAL_CALL \
66 transliterateChar2Char( sal_Unicode inChar) \
67 override; \
70 TRANSLITERATION_ONETOONE( fullwidthToHalfwidth )
71 TRANSLITERATION_ONETOONE( FULLWIDTHKATAKANA_HALFWIDTHKATAKANA )
72 TRANSLITERATION_ONETOONE( FULLWIDTH_HALFWIDTH_LIKE_ASC )
74 class halfwidthToFullwidth final : public transliteration_OneToOne
76 public:
77 halfwidthToFullwidth();
78 OUString
79 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
81 class HALFWIDTHKATAKANA_FULLWIDTHKATAKANA final : public transliteration_OneToOne
83 public:
84 HALFWIDTHKATAKANA_FULLWIDTHKATAKANA();
85 OUString
86 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
88 class HALFWIDTH_FULLWIDTH_LIKE_JIS final : public transliteration_OneToOne
90 public:
91 HALFWIDTH_FULLWIDTH_LIKE_JIS();
92 OUString
93 transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >* pOffset ) override;
96 #undef TRANSLITERATION_ONETOONE
98 #define TRANSLITERATION_ONETOONE( name ) \
99 class name final : public transliteration_OneToOne \
101 public: \
102 name (); \
105 TRANSLITERATION_ONETOONE(hiraganaToKatakana)
106 TRANSLITERATION_ONETOONE(katakanaToHiragana)
107 TRANSLITERATION_ONETOONE(largeToSmall_ja_JP)
108 TRANSLITERATION_ONETOONE(smallToLarge_ja_JP)
110 #undef TRANSLITERATION_ONETOONE
114 #endif // INCLUDED_I18NPOOL_INC_TRANSLITERATION_ONETOONE_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */