本文整理汇总了C++中Language::lang方法的典型用法代码示例。如果您正苦于以下问题:C++ Language::lang方法的具体用法?C++ Language::lang怎么用?C++ Language::lang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::lang方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
void Languages::read(FileName const & filename)
{
Lexer lex;
lex.setFile(filename);
lex.setContext("Languages::read");
while (lex.isOK()) {
int le = lex.lex();
switch (le) {
case Lexer::LEX_FEOF:
continue;
default:
break;
}
if (lex.getString() != "Language") {
lex.printError("Unknown Language tag `$$Token'");
continue;
}
Language l;
l.read(lex);
if (!lex)
break;
if (l.lang() == "latex") {
// Check if latex language was not already defined.
LASSERT(latex_language == 0, continue);
static const Language latex_lang = l;
latex_language = &latex_lang;
} else if (l.lang() == "ignore") {
示例2: read
void Languages::read(FileName const & filename)
{
Lexer lex;
lex.setFile(filename);
lex.setContext("Languages::read");
while (lex.isOK()) {
int le = lex.lex();
switch (le) {
case Lexer::LEX_FEOF:
continue;
default:
break;
}
if (lex.getString() != "Language") {
lex.printError("Unknown Language tag `$$Token'");
continue;
}
Language l;
l.read(lex);
if (!lex)
break;
if (l.lang() == "latex")
latex_lang = l;
else if (l.lang() == "ignore")
ignore_lang = l;
else
languagelist[l.lang()] = l;
}
default_language = getLanguage(lyxrc.default_language);
if (!default_language) {
LYXERR0("Default language \"" << lyxrc.default_language
<< "\" not found!");
default_language = getLanguage("english");
if (!default_language)
default_language = &(*languagelist.begin()).second;
LYXERR0("Using \"" << default_language->lang() << "\" instead!");
}
// Read layout translations
FileName const path = libFileSearch(string(), "layouttranslations");
readLayoutTranslations(path);
}