00001
00014 #ifndef CXXUTILS_STRINGUTILS_AUX_H
00015 #define CXXUTILS_STRINGUTILS_AUX_H
00016
00017
00018
00019 const size_t utf8_skip_data[256] = {
00020 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00021 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00022 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00023 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00024 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00025 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00026 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
00027 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1
00028 };
00029
00030
00031
00032
00033 #define STRINGUTILS__N_MAP_SPECIALSCRIPT 70
00034 const std::string map_specialscript[STRINGUTILS__N_MAP_SPECIALSCRIPT][3] = {
00035 {"0","⁰","0" },
00036 {"1","¹","₁"} ,
00037 {"2","²","₂"},
00038 {"3","³","₃"},
00039 {"4","⁴","₄"},
00040 {"5","⁵","₅"},
00041 {"6","⁶","₆"},
00042 {"7","⁷","₇"},
00043 {"8","⁸","₈"},
00044 {"9","⁹","₉"},
00045 {"+","⁺","₊"},
00046 {"-","⁻","₋"},
00047 {"=","⁼","₌"},
00048 {"(","⁽","₍"},
00049 {")","⁾","₎"},
00050 {"a","ᵃ","ₐ"},
00051 {"b","ᵇ","b"},
00052 {"c","ᶜ","c"},
00053 {"d","ᵈ","d"},
00054 {"e","ᵉ","ₑ"},
00055 {"f","ᶠ","f"},
00056 {"g","ᵍ","g"},
00057 {"h","ʰ","ₕ"},
00058 {"i","ⁱ","ᵢ"},
00059 {"j","ʲ","ⱼ"},
00060 {"k","ᵏ","ₖ"},
00061 {"l","ˡ","ₗ"},
00062 {"m","ᵐ","ₘ"},
00063 {"n","ⁿ","ₙ"},
00064 {"o","ᵒ","ₒ"},
00065 {"p","ᵖ","ₚ"},
00066 {"r","ʳ","ᵣ"},
00067 {"s","ˢ","ₛ"},
00068 {"t","ᵗ","ₜ"},
00069 {"u","ᵘ","ᵤ"},
00070 {"v","ᵛ","ᵥ"},
00071 {"w","ʷ","w"},
00072 {"x","ˣ","ₓ"},
00073 {"y","ʸ","y"},
00074 {"z","ᶻ","z"},
00075 {"A","ᴬ","A"},
00076 {"B","ᴮ","B"},
00077 {"D","ᴰ","D"},
00078 {"E","ᴱ","E"},
00079 {"G","ᴳ","G"},
00080 {"H","ᴴ","H"},
00081 {"I","ᴵ","I"},
00082 {"J","ᴶ","J"},
00083 {"K","ᴷ","K"},
00084 {"L","ᴸ","L"},
00085 {"M","ᴹ","M"},
00086 {"N","ᴺ","N"},
00087 {"O","ᴼ","O"},
00088 {"P","ᴾ","P"},
00089 {"R","ᴿ","R"},
00090 {"T","ᵀ","T"},
00091 {"U","ᵁ","U"},
00092 {"V","ⱽ","V"},
00093 {"W","ᵂ","W"},
00094 {"α","ᵅ","α"},
00095 {"β","ᵝ","ᵦ"},
00096 {"γ","ᵞ","ᵧ"},
00097 {"δ","ᵟ","δ"},
00098 {"ρ","ρ","ᵨ"},
00099 {"ε","ᵋ","ε"},
00100 {"θ","ᶿ","θ"},
00101 {"ι","ᶥ","ι"},
00102 {"Φ","ᶲ","Φ"},
00103 {"φ","ᵠ","ᵩ"},
00104 {"χ","ᵡ","ᵪ"}
00105 };
00106
00107 const std::string map_superscript_starters[4] = {
00108 "","","\\ensuremath{^{","<sup>"
00109 };
00110 const std::string map_superscript_enders[4] = {
00111 "","","}}","</sup>"
00112 };
00113 const std::string map_subscript_starters[4] = {
00114 "","","\\ensuremath{_{","<sub>"
00115 };
00116 const std::string map_subscript_enders[4] = {
00117 "","","}}","</sub>"
00118 };
00119
00120
00121
00122
00123
00124
00125
00126
00127 #define STRINGUTILS__N_MAP_FORMAT 94
00128 const std::string map_format[STRINGUTILS__N_MAP_FORMAT][4] = {
00129 { " " ," "," " ," " },
00130 { " " ," ","~" ," " },
00131 { "x" ,"x", "x" ,"x" },
00132 { "0" ,"0", "0" ,"0" },
00133 { "E" ,"E", "E" ,"E" },
00134 { "Alpha", "Α", "\\Alpha", "Α" },
00135 { "Beta", "Β", "\\Beta", "Β" },
00136 { "Gamma", "Γ", "\\Gamma", "Γ" },
00137 { "Delta", "Δ", "\\Delta", "Δ" },
00138 { "Epsilon","Ε", "\\Epsilon","Ε" },
00139 { "Zeta", "Ζ", "\\Zeta", "Ζ" },
00140 { "Eta", "Η", "\\Eta", "Η" },
00141 { "Theta", "Θ", "\\Theta", "Θ" },
00142 { "Iota", "I", "\\Iota", "Ι" },
00143 { "Kappa", "Κ", "\\Kappa", "Κ" },
00144 { "Lambda", "Λ", "\\Lambda", "Λ" },
00145 { "Mu", "M", "\\Mu", "Μ" },
00146 { "Nu", "Ν", "\\Nu", "Ν" },
00147 { "Xi", "Ξ", "\\Xi", "Ξ" },
00148 { "Omicron","Ο", "\\Omicron","Ο" },
00149 { "Pi", "Π", "\\Pi", "Π" },
00150 { "Rho", "Ρ", "\\Rho", "Ρ" },
00151 { "Sigma", "Σ", "\\Sigma", "Σ" },
00152 { "Tau", "Τ", "\\Tau", "Τ" },
00153 { "Upsilon","Υ", "\\Upsilon","Υ" },
00154 { "Phi", "Φ", "\\Phi", "Φ" },
00155 { "Chi", "Χ", "\\Chi", "Χ" },
00156 { "Psi", "Ψ", "\\Psi", "Ψ" },
00157 { "Omega", "Ω", "\\Omega", "Ω" },
00158 { "alpha" ,"α", "\\alpha" ,"α" },
00159 { "beta" ,"β", "\\beta" ,"β" },
00160 { "gamma" ,"γ", "\\gamma" ,"γ" },
00161 { "delta" ,"δ", "\\delta" ,"δ" },
00162 { "epsilon","ε", "\\epsilon","ε" },
00163 { "zeta" ,"ζ", "\\zeta" ,"ζ" },
00164 { "eta" ,"η", "\\eta" ,"η" },
00165 { "theta" ,"θ", "\\theta" ,"θ" },
00166 { "iota" ,"ι", "\\iota" ,"ι" },
00167 { "kappa" ,"κ", "\\kappa" ,"κ" },
00168 { "lambda" ,"λ", "\\lambda" ,"λ" },
00169 { "mu" ,"μ", "\\mu" ,"μ" },
00170 { "nu" ,"ν", "\\nu" ,"ν" },
00171 { "xi" ,"ξ", "\\xi" ,"ξ" },
00172 { "omicron","ο", "\\omicron","ο" },
00173 { "pi" ,"π", "\\pi" ,"π" },
00174 { "rho" ,"ρ", "\\rho" ,"ρ" },
00175 { "sigma" ,"σ", "\\sigma" ,"σ" },
00176 { "varsigma","ς", "\\varsigma","&vsigma;" },
00177 { "tau" ,"τ", "\\tau" ,"τ" },
00178 { "upsilon","υ", "\\upsilon","υ" },
00179 { "phi" ,"φ", "\\phi" ,"φ" },
00180 { "chi" ,"χ", "\\chi" ,"χ" },
00181 { "psi" ,"ψ", "\\psi" ,"ψ" },
00182 { "omega" ,"ω", "\\omega" ,"ω" },
00183 { "-|" ,"¬", "\\neg" ,"¬" },
00184 { "+/-" ,"±", "\\pm" ,"±" },
00185 { "*" ,"*", "\\ast" ,"*" },
00186 { "*" ,"·", "\\cdot" ,"·" },
00187 { "x" ,"×", "\\times" ,"×" },
00188 { "->" ,"→", "\\righarrow" ,"&rarr" },
00189 { "->" ,"→", "\\to" ,"&rarr" },
00190 { "<-" ,"←", "\\leftarrow" ,"&larr" },
00191 { "<=" ,"⇐", "\\Leftarrow" ,"⇐" },
00192 { "=>" ,"⇒", "\\Rightarrow","⇒" },
00193 { "<=>" ,"⇔", "\\Leftrightarrow","⇔"},
00194 { "(Vx)" ,"∀", "\\forall" ,"∀" },
00195 { "del" ,"∂", "\\partial","∂" },
00196 { "(Ex)" ,"∃", "\\exists" ,"∃" },
00197 { "0" ,"∅","\\emptyset","∅" },
00198 { "Nabla" ,"∇","\\nabla" ,"∇" },
00199 { "inf" ,"∞","\\infty" ,"∞" },
00200 { "isElem" ,"∈","\\in" ,"∈" },
00201 { "is!Elem","∉","\\not\\in" ,"∉" },
00202 { "Prod|" ,"∏","\\prod" ,"∏" },
00203 { "Sum|" ,"∑","\\sum" ,"∑" },
00204 { "sqrt|" ,"√","\\surd" ,"√" },
00205 { "/\\" ,"∧","\\wedge" ,"∧" },
00206 { "\\/" ,"∨","\\vee" ,"∨" },
00207 { "/\\" ,"∩","\\cap" ,"∩" },
00208 { "\\/" ,"∪","\\cup" ,"∪" },
00209 { "Int|" ,"∫","\\int" ,"∫" },
00210 { "~" ,"≈","\\approx" ,"≈" },
00211 { "!=" ,"≠","\\neq" ,"≠" },
00212 { "==" ,"≡","\\equiv" ,"≡" },
00213 { "<=" ,"≤","\\leq" ,"≤" },
00214 { ">=" ,"≥","\\geq" ,"≥" },
00215 { ">" ,"⊂","\\subset" ,"⊂" },
00216 { "<" ,"⊃","\\supset" ,"⊃" },
00217 { "°" ,"°","^\\circ" ,"°" },
00218 { "floor[" ,"⌊","\\lfloor" ,"⌊" },
00219 { "ceil[" ,"⌈","\\lceil" ,"⌈" },
00220 { "]" ,"]","\\[" ,"[" },
00221 { "]" ,"⌋","\\rfloor" ,"⌋" },
00222 { "]" ,"⌉","\\rceil" ,"⌉" }
00223 };
00224
00225 #endif //CXXUTILS_STRINGUTILS_AUX_H