/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_I18NUTIL_ONETOONEMAPPING_HXX #define INCLUDED_I18NUTIL_ONETOONEMAPPING_HXX #include #include #include namespace i18nutil { struct OneToOneMappingTable_t { sal_Unicode first; sal_Unicode second; }; typedef sal_Int8 UnicodePairFlag; struct UnicodePairWithFlag { sal_Unicode first; sal_Unicode second; UnicodePairFlag flag; }; class UNLESS_MERGELIBS(I18NUTIL_DLLPUBLIC) oneToOneMapping { private: oneToOneMapping(const oneToOneMapping&) = delete; oneToOneMapping& operator=(const oneToOneMapping&) = delete; public: oneToOneMapping( OneToOneMappingTable_t const *rpTable, const size_t rnSize, const size_t rnUnitSize = sizeof(OneToOneMappingTable_t) ); virtual ~oneToOneMapping(); // binary search virtual sal_Unicode find( const sal_Unicode nKey ) const; // translator sal_Unicode operator[] ( const sal_Unicode nKey ) const { return find( nKey ); }; protected: OneToOneMappingTable_t const *mpTable; size_t mnSize; }; class oneToOneMappingWithFlag final : public oneToOneMapping { private: oneToOneMappingWithFlag(const oneToOneMappingWithFlag&) = delete; oneToOneMappingWithFlag& operator=(const oneToOneMappingWithFlag&) = delete; friend class widthfolding; public: oneToOneMappingWithFlag( UnicodePairWithFlag const *rpTableWF, const size_t rnSize, const UnicodePairFlag rnFlag ); virtual ~oneToOneMappingWithFlag() override; // make index for fast search void makeIndex(); // index search virtual sal_Unicode find( const sal_Unicode nKey ) const override; private: UnicodePairWithFlag const *mpTableWF; UnicodePairFlag mnFlag; std::unique_ptr mpIndex[256]; bool mbHasIndex; }; } #endif // _I18N_TRANSLITERATION_ONETOONEMAPPING_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2012-02-23Adapted AsyncEventNotifier to safer-to-use salhelper::ThreadStephan Bergmann
2012-02-13Make simplified configuration API available down in comphelperStephan Bergmann
2011-06-18ause130: #i117218# change .idl handling to gnu makeHans-Joachim Lankenau
2011-03-11Merge commit 'ooo/DEV300_m101' into intm101Jan Holesovsky
2011-02-16Cleanup in comphelper unit tests.Sébastien Le Ray
2011-02-10DEV300 masterfix: #i10000#: fix typoJens-Heiner Rechtien [hr]
2011-02-08Fix comphelper parallel build, so that the tests may run.Jan Holesovsky
2011-02-07Re-animated tests that were based on deprecated testshl.Wilhelm Pflueger
2011-01-26gnumake3: adjust comphelper to new build envCarsten Driesner
2010-10-25Finally, gut the vos module out of the buildNorbert Thiebaud
2010-10-22sb131: #i115124# $(XSLTPROC) implies LIBXSLT:libxsltsb
2010-06-07sb123:#i111449# cleanups in comphelper qa complex testsLars Langhans
2006-10-30INTEGRATION: CWS ause060 (1.9.228); FILE MERGEDRüdiger Timm
2006-10-13INTEGRATION: CWS opofxmlstorage (1.9.184); FILE MERGEDOliver Bolte
2004-07-23INTEGRATION: CWS sb20 (1.8.26); FILE MERGEDRüdiger Timm
2004-05-10INTEGRATION: CWS relocinst (1.6.118); FILE MERGEDJens-Heiner Rechtien
2004-04-21INTEGRATION: CWS loadenv01 (1.6.112); FILE MERGEDSander Vesik
2002-04-30#65293#: removed dependency on vclJens-Heiner Rechtien
2002-04-29#65293#: comphelper is dependend on vclJens-Heiner Rechtien
2002-01-11#95512# new AnyCompareFactory service implementationMikhail Voitenko