office-gobmx/i18npool/source/transliteration/hiraganaToKatakana.cxx
Oliver Bolte 134b474a26 INTEGRATION: CWS pchfix02 (1.8.80); FILE MERGED
2006/09/01 17:30:50 kaib 1.8.80.1: #i68856# Added header markers and pch files
2006-09-17 08:25:53 +00:00

69 lines
2.4 KiB
C++

/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: hiraganaToKatakana.cxx,v $
*
* $Revision: 1.9 $
*
* last change: $Author: obo $ $Date: 2006-09-17 09:25:24 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_i18npool.hxx"
// prevent internal compiler error with MSVC6SP3
#include <utility>
#define TRANSLITERATION_hiraganaToKatakana
#include <transliteration_OneToOne.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace rtl;
namespace com { namespace sun { namespace star { namespace i18n {
// see http://charts.unicode.org/Web/U3040.html Hiragana (U+3040..U+309F)
// see http://charts.unicode.org/Web/U30A0.html Katakana (U+30A0..U+30FF)
static sal_Unicode toKatakana (const sal_Unicode c) {
if (0x3041 <= c && c <= 0x3096 || 0x309d <= c && c <= 0x309f) { // 3040 - 309F HIRAGANA LETTER
// shift code point by 0x0060
return c + (0x30a0 - 0x3040);
}
return c;
}
hiraganaToKatakana::hiraganaToKatakana()
{
func = toKatakana;
table = 0;
transliterationName = "hiraganaToKatakana";
implementationName = "com.sun.star.i18n.Transliteration.HIRAGANA_KATAKANA";
}
} } } }