Encoding::Encoding(string const & n, string const & l, string const & i,
bool f, Encoding::Package p)
- : Name_(n), LatexName_(l), iconvName_(i), fixedwidth_(f), package_(p)
+ : name_(n), latexName_(l), iconvName_(i), fixedwidth_(f), package_(p)
{
if (n == "ascii") {
// ASCII can encode 128 code points and nothing else
}
-bool Encodings::isComposeChar_hebrew(char_type c)
+bool Encodings::isHebrewComposeChar(char_type c)
{
return c <= 0x05c2 && c >= 0x05b0 && c != 0x05be && c != 0x05c0;
}
// they are hamza, alef_madda, alef_hamza, waw_hamza, alef_hamza_under,
// alef, tah_marbota, dal, thal, rah, zai, wow, alef_maksoura
-bool Encodings::is_arabic_special(char_type c)
+bool Encodings::isArabicSpecialChar(char_type c)
{
return (c >= 0x0621 && c <= 0x0625) || (c >= 0x0630 && c <= 0x0632)
|| c == 0x0627 || c == 0x0629 || c == 0x062f || c == 0x0648
}
-bool Encodings::isComposeChar_arabic(char_type c)
+bool Encodings::isArabicComposeChar(char_type c)
{
return c >= 0x064b && c <= 0x0652;
}
-bool Encodings::is_arabic(char_type c)
+bool Encodings::isArabicChar(char_type c)
{
return c >= arabic_start && c <= arabic_end
&& arabic_table[c-arabic_start][0];
}
-char_type Encodings::transformChar(char_type c, Encodings::Letter_Form form)
+char_type Encodings::transformChar(char_type c, Encodings::LetterForm form)
{
- return is_arabic(c) ? arabic_table[c-arabic_start][form] : c;
+ return isArabicChar(c) ? arabic_table[c-arabic_start][form] : c;
}
}
-Encoding const * Encodings::getFromLyXName(string const & name) const
+Encoding const * Encodings::fromLyXName(string const & name) const
{
EncodingList::const_iterator const it = encodinglist.find(name);
return it != encodinglist.end() ? &it->second : 0;
}
-Encoding const * Encodings::getFromLaTeXName(string const & name) const
+Encoding const * Encodings::fromLaTeXName(string const & name) const
{
// We don't use find_if because it makes copies of the pairs in
// the map.
{
// We must read the symbolsfile first, because the Encoding
// constructor depends on it.
- Lexer symbolslex(0, 0);
+ Lexer symbolslex;
symbolslex.setFile(symbolsfile);
while (symbolslex.isOK()) {
char_type symbol;
}
// Now read the encodings
- enum Encodingtags {
+ enum {
et_encoding = 1,
et_end,
- et_last
};
- struct keyword_item encodingtags[et_last - 1] = {
+ LexerKeyword encodingtags[] = {
{ "encoding", et_encoding },
{ "end", et_end }
};
- Lexer lex(encodingtags, et_last - 1);
+ Lexer lex(encodingtags);
lex.setFile(encfile);
+ lex.setContext("Encodings::read");
while (lex.isOK()) {
switch (lex.lex()) {
case et_encoding:
else if (width == "variable")
fixedwidth = false;
else
- lex.printError("Encodings::read: "
- "Unknown width: `$$Token'");
+ lex.printError("Unknown width");
lex.next();
string const p = lex.getString();
Encoding::Package package = Encoding::none;
if (p == "none")
- package = Encoding::none;
+ package = Encoding::none;
else if (p == "inputenc")
package = Encoding::inputenc;
else if (p == "CJK")
package = Encoding::CJK;
else
- lex.printError("Encodings::read: "
- "Unknown package: `$$Token'");
+ lex.printError("Unknown package");
LYXERR(Debug::INFO, "Reading encoding " << name);
encodinglist[name] = Encoding(name, latexname,
iconvname, fixedwidth, package);
if (lex.lex() != et_end)
- lex.printError("Encodings::read: "
- "missing end");
+ lex.printError("Missing end");
break;
}
case et_end:
- lex.printError("Encodings::read: Misplaced end");
+ lex.printError("Misplaced end");
break;
case Lexer::LEX_FEOF:
break;
default:
- lex.printError("Encodings::read: "
- "Unknown tag: `$$Token'");
+ lex.printError("Unknown tag");
break;
}
}