aboutsummaryrefslogtreecommitdiffstats
path: root/doc/api-documentation/html/utf8transliterator_8h-source.html
blob: d859019af36327b945e61fec2cf465ef69df5e59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>utf8transliterator.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.17 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>utf8transliterator.h</h1><div class="fragment"><pre>00001 <span class="comment">/*</span>
00002 <span class="comment"> *</span>
00003 <span class="comment"> * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)</span>
00004 <span class="comment"> *      CrossWire Bible Society</span>
00005 <span class="comment"> *      P. O. Box 2528</span>
00006 <span class="comment"> *      Tempe, AZ  85280-2528</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * This program is free software; you can redistribute it and/or modify it</span>
00009 <span class="comment"> * under the terms of the GNU General Public License as published by the</span>
00010 <span class="comment"> * Free Software Foundation version 2.</span>
00011 <span class="comment"> *</span>
00012 <span class="comment"> * This program is distributed in the hope that it will be useful, but</span>
00013 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
00015 <span class="comment"> * General Public License for more details.</span>
00016 <span class="comment"> *</span>
00017 <span class="comment"> */</span>
00018 
00019 <span class="preprocessor">#ifndef UTF8TRANSLITERATOR_H</span>
00020 <span class="preprocessor"></span><span class="preprocessor">#define UTF8TRANSLITERATOR_H</span>
00021 <span class="preprocessor"></span>
00022 <span class="keyword">enum</span> scriptEnum {SE_OFF, SE_LATIN, <span class="comment">/*one-way (to) transliterators*/</span> SE_BASICLATIN, SE_BETA, SE_BGREEK, <span class="comment">/*two-way transliterators*/</span> SE_GREEK, SE_HEBREW, SE_CYRILLIC, SE_ARABIC, SE_SYRIAC, SE_KATAKANA, SE_HIRAGANA, SE_JAMO, SE_HANGUL, SE_DEVANAGARI, SE_TAMIL, SE_BENGALI, SE_GURMUKHI, SE_GUJARATI, SE_ORIYA, SE_TELUGU, SE_KANNADA, SE_MALAYALAM, SE_THAI, SE_GEORGIAN, SE_ARMENIAN, SE_ETHIOPIC, SE_GOTHIC, SE_UGARITIC, SE_COPTIC, <span class="comment">/*one-way (from) transliterators*/</span> SE_HAN, SE_KANJI};
00023 <span class="preprocessor">#define NUMSCRIPTS 32</span>
00024 <span class="preprocessor"></span><span class="preprocessor">#define NUMTARGETSCRIPTS 5</span>
00025 <span class="preprocessor"></span>
00026 <span class="preprocessor">#include &lt;swfilter.h&gt;</span>
00027 <span class="preprocessor">#include &lt;swmodule.h&gt;</span>
00028 
00029 <span class="comment">//#include &lt;unicode/utypes.h&gt;</span>
00030 <span class="comment">//#include &lt;unicode/ucnv.h&gt;</span>
00031 <span class="comment">//#include &lt;unicode/ustring.h&gt;</span>
00032 <span class="comment">//#include &lt;unicode/uchar.h&gt;</span>
00033 
00034 <span class="preprocessor">#include &lt;unicode/unistr.h&gt;</span>
00035 <span class="preprocessor">#include &lt;unicode/translit.h&gt;</span>
00036 
00037 <span class="preprocessor">#include &lt;defs.h&gt;</span>
00038 <span class="preprocessor">#include &lt;map&gt;</span>
00039 
00040 
00041 <span class="comment">//class UnicodeString;</span>
00042 
00043 SWORD_NAMESPACE_START
00044 
00045 <span class="keyword">struct </span>SWTransData {
00046         UnicodeString resource;
00047         UTransDirection dir;
00048 };
00049 <span class="keyword">typedef</span> std::map &lt;const UnicodeString, SWTransData&gt; SWTransMap;
00050 <span class="keyword">typedef</span> std::pair&lt;UnicodeString, SWTransData&gt; SWTransPair;
00051 
<a name="l00054"></a><a class="code" href="classsword_1_1_u_t_f8_transliterator.html">00054</a> <span class="keyword">class </span>SWDLLEXPORT <a class="code" href="classsword_1_1_u_t_f8_transliterator.html">UTF8Transliterator</a> : <span class="keyword">public</span> SWFilter
00055 {
00056 <span class="keyword">private</span>:
00057 
00058   <span class="keywordtype">char</span> option;
00059 
00060   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> optionstring[NUMTARGETSCRIPTS][16];
00061 
00062   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> optName[];
00063   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> optTip[];
00064   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> SW_RB_RULE_BASED_IDS[];
00065   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> SW_RB_RULE[];
00066   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> SW_RESDATA[];
00067   <a class="code" href="namespacesword.html#a82">OptionsList</a> options;
00068   <span class="keyword">static</span> SWTransMap transMap;
00069   UErrorCode utf8status;
00070   
00071   <span class="keywordtype">void</span> Load(UErrorCode &amp;status);
00072   <span class="keywordtype">void</span>  registerTrans(<span class="keyword">const</span> UnicodeString&amp; ID, <span class="keyword">const</span> UnicodeString&amp; resource,
00073                 UTransDirection dir, UErrorCode &amp;status );
00074   <span class="keywordtype">bool</span> checkTrans(<span class="keyword">const</span> UnicodeString&amp; ID, UErrorCode &amp;status );
00075   Transliterator * createTrans(<span class="keyword">const</span> UnicodeString&amp; preID, <span class="keyword">const</span> UnicodeString&amp; ID, 
00076         <span class="keyword">const</span> UnicodeString&amp; postID, UTransDirection dir, UErrorCode &amp;status );
00077   
00078  <span class="keyword">public</span>:
00079   <a class="code" href="classsword_1_1_u_t_f8_transliterator.html">UTF8Transliterator</a> ();
00080   <span class="keyword">virtual</span> <span class="keywordtype">char</span> ProcessText (<span class="keywordtype">char</span> *text, <span class="keywordtype">int</span> maxlen, <span class="keyword">const</span> <a class="code" href="classsword_1_1_s_w_key.html">SWKey</a> * key, <span class="keyword">const</span> <a class="code" href="classsword_1_1_s_w_module.html">SWModule</a> * = 0);
00081   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *getOptionName ()
00082     {
00083       <span class="keywordflow">return</span> optName;
00084     }
00085   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *getOptionTip ()
00086     {
00087       <span class="keywordflow">return</span> optTip;
00088     }
00089   <span class="keyword">virtual</span> <span class="keywordtype">void</span> setOptionValue (<span class="keyword">const</span> <span class="keywordtype">char</span> *ival);
00090   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *getOptionValue ();
00091   <span class="keyword">virtual</span> <a class="code" href="namespacesword.html#a82">OptionsList</a> getOptionValues ()
00092     {
00093       <span class="keywordflow">return</span> options;
00094     }
00095 };
00096 
00097 SWORD_NAMESPACE_END
00098 <span class="preprocessor">#endif</span>
</pre></div><hr><address style="align: right;"><small>Generated on Thu Oct 31 12:11:28 2002 for The Sword Project by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.17 </small></address>
</body>
</html>