Open Chinese Convert: Common.hpp Source File

Open Chinese Convert 1.3.2+gad37fd0a6.dirty A project for conversion between Traditional and Simplified Chinese

Loading...
Searching...
No Matches
Common.hpp
1/*
2 * Open Chinese Convert
3 *
4 * Copyright 2010-2014 Carbo Kuo <byvoid@byvoid.com>
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#pragma once
20
21// Microsoft Visual C++ specific
22#if defined(_MSC_VER) && (_MSC_VER >= 1020)
23#pragma warning(disable : 4251 4266 4350 4503 4512 4514 4710 4820)
24#endif
25
26#include <cstddef>
27#include <memory>
28#include <string>
29#include <vector>
30
31#include "Export.hpp"
32#include "Optional.hpp"
33#include "opencc_config.h"
34
35// Forward decalarations and alias
36namespace opencc {
37class Config;
38class Conversion;
39class ConversionChain;
40class Converter;
41class Dict;
42class DictEntry;
43class DictGroup;
44class Lexicon;
45class MarisaDict;
46class MultiValueDictEntry;
47class NoValueDictEntry;
48class Segmentation;
49class Segments;
50class SerializableDict;
51class SingleValueDictEntry;
52class TextDict;
53typedef std::shared_ptr<Conversion> ConversionPtr;
54typedef std::shared_ptr<ConversionChain> ConversionChainPtr;
55typedef std::shared_ptr<Converter> ConverterPtr;
56typedef std::shared_ptr<Dict> DictPtr;
57typedef std::shared_ptr<DictGroup> DictGroupPtr;
58typedef std::shared_ptr<Lexicon> LexiconPtr;
59typedef std::shared_ptr<MarisaDict> MarisaDictPtr;
60typedef std::shared_ptr<Segmentation> SegmentationPtr;
61typedef std::shared_ptr<Segments> SegmentsPtr;
62typedef std::shared_ptr<SerializableDict> SerializableDictPtr;
63typedef std::shared_ptr<TextDict> TextDictPtr;
64
65#ifdef OPENCC_ENABLE_DARTS
66class BinaryDict;
67class DartsDict;
68typedef std::shared_ptr<BinaryDict> BinaryDictPtr;
69typedef std::shared_ptr<DartsDict> DartsDictPtr;
70#endif
71
72} // namespace opencc
73
74#ifndef PKGDATADIR
75const std::string PACKAGE_DATA_DIRECTORY = "";
76#else // ifndef PKGDATADIR
77const std::string PACKAGE_DATA_DIRECTORY = PKGDATADIR "/";
78#endif // ifndef PKGDATADIR
79
80#ifndef OPENCC_SEGMENTATION_PLUGIN_DIR
81const std::string PACKAGE_SEGMENTATION_PLUGIN_DIRECTORY = "";
82#else
83const std::string PACKAGE_SEGMENTATION_PLUGIN_DIRECTORY =
84 OPENCC_SEGMENTATION_PLUGIN_DIR "/";
85#endif
86
87#ifndef OPENCC_VERSION
88#define OPENCC_VERSION "1.3.*"
89#endif // ifndef OPENCC_VERSION
opencc::BinaryDict
Binary dictionary for faster deserialization.
Definition BinaryDict.hpp:29
opencc::Config
Configuration loader.
Definition Config.hpp:36
opencc::ConversionChain
An ordered sequence of Conversion objects applied to pre-segmented text.
Definition ConversionChain.hpp:41
opencc::Conversion
Single-dictionary phrase conversion.
Definition Conversion.hpp:43
opencc::Converter
Abstract base for full-text converters.
Definition Converter.hpp:44
opencc::DartsDict
Darts dictionary.
Definition DartsDict.hpp:29
opencc::DictEntry
Key-values pair entry.
Definition DictEntry.hpp:32
opencc::DictGroup
Group of dictionaries.
Definition DictGroup.hpp:44
opencc::Dict
Abstract class of dictionary.
Definition Dict.hpp:63
opencc::Lexicon
Storage of all entries.
Definition Lexicon.hpp:29
opencc::MarisaDict
Darts dictionary.
Definition MarisaDict.hpp:36
opencc::MultiValueDictEntry
Definition DictEntry.hpp:123
opencc::NoValueDictEntry
Definition DictEntry.hpp:62
opencc::Segmentation
Abstract base for text segmentation.
Definition Segmentation.hpp:38
opencc::Segments
Segmented text.
Definition Segments.hpp:32
opencc::SerializableDict
Serializable dictionary interface.
Definition SerializableDict.hpp:32
opencc::SingleValueDictEntry
Definition DictEntry.hpp:85
opencc::TextDict
Text dictionary.
Definition TextDict.hpp:29