本文整理汇总了C++中Lexer::getLongString方法的典型用法代码示例。如果您正苦于以下问题:C++ Lexer::getLongString方法的具体用法?C++ Lexer::getLongString怎么用?C++ Lexer::getLongString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lexer
的用法示例。
在下文中一共展示了Lexer::getLongString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
//.........这里部分代码省略.........
<< style << "'\n"
<< "All InsetLayouts so far:");
TextClass::InsetLayouts::const_iterator lit =
tclass.insetLayouts().begin();
TextClass::InsetLayouts::const_iterator len =
tclass.insetLayouts().end();
for (; lit != len; ++lit)
lyxerr << lit->second.name() << "\n";
}
break;
}
case IL_FONT: {
font_ = lyxRead(lex, inherit_font);
// If you want to define labelfont, you need to do so after
// font is defined.
labelfont_ = font_;
break;
}
case IL_RESETARGS:
bool reset;
lex >> reset;
if (reset)
latexargs_.clear();
break;
case IL_ARGUMENT:
readArgument(lex);
break;
case IL_BGCOLOR:
lex >> tmp;
bgcolor_ = lcolor.getFromLyXName(tmp);
break;
case IL_PREAMBLE:
preamble_ = from_utf8(lex.getLongString("EndPreamble"));
break;
case IL_BABELPREAMBLE:
babelpreamble_ = from_utf8(lex.getLongString("EndBabelPreamble"));
break;
case IL_LANGPREAMBLE:
langpreamble_ = from_utf8(lex.getLongString("EndLangPreamble"));
break;
case IL_REFPREFIX:
lex >> refprefix_;
break;
case IL_HTMLTAG:
lex >> htmltag_;
break;
case IL_HTMLATTR:
lex >> htmlattr_;
break;
case IL_HTMLFORCECSS:
lex >> htmlforcecss_;
break;
case IL_HTMLINNERTAG:
lex >> htmlinnertag_;
break;
case IL_HTMLINNERATTR:
lex >> htmlinnerattr_;
break;
case IL_HTMLLABEL:
lex >> htmllabel_;
break;
case IL_HTMLISBLOCK:
lex >> htmlisblock_;
break;
case IL_HTMLSTYLE:
示例2: readFloat
//.........这里部分代码省略.........
lexrc.printError("Unknown float tag `$$Token'");
continue;
default:
break;
}
switch (le) {
case FT_TYPE:
lexrc.next();
type = lexrc.getString();
if (floatlist_.typeExist(type)) {
Floating const & fl = floatlist_.getType(type);
placement = fl.placement();
ext = fl.ext();
within = fl.within();
style = fl.style();
name = fl.name();
listname = fl.listName();
needsfloat = fl.needsFloatPkg();
listcommand = fl.listCommand();
refprefix = fl.refPrefix();
}
break;
case FT_NAME:
lexrc.next();
name = lexrc.getString();
break;
case FT_PLACEMENT:
lexrc.next();
placement = lexrc.getString();
break;
case FT_EXT:
lexrc.next();
ext = lexrc.getString();
break;
case FT_WITHIN:
lexrc.next();
within = lexrc.getString();
if (within == "none")
within.erase();
break;
case FT_STYLE:
lexrc.next();
style = lexrc.getString();
break;
case FT_LISTCOMMAND:
lexrc.next();
listcommand = lexrc.getString();
break;
case FT_REFPREFIX:
lexrc.next();
refprefix = lexrc.getString();
break;
case FT_LISTNAME:
lexrc.next();
listname = lexrc.getString();
break;
case FT_NEEDSFLOAT:
lexrc.next();
needsfloat = lexrc.getBool();
break;
case FT_HTMLATTR:
lexrc.next();
htmlattr = lexrc.getString();
break;
case FT_HTMLSTYLE:
lexrc.next();
htmlstyle = lexrc.getLongString("EndHTMLStyle");
break;
case FT_HTMLTAG:
lexrc.next();
htmltag = lexrc.getString();
break;
case FT_END:
getout = true;
break;
}
}
lexrc.popTable();
// Here we have a full float if getout == true
if (getout) {
if (!needsfloat && listcommand.empty())
LYXERR0("The layout does not provide a list command " <<
"for the builtin float `" << type << "'. LyX will " <<
"not be able to produce a float list.");
Floating fl(type, placement, ext, within, style, name,
listname, listcommand, refprefix,
htmltag, htmlattr, htmlstyle, needsfloat);
floatlist_.newFloat(fl);
// each float has its own counter
counters_.newCounter(from_ascii(type), from_ascii(within),
docstring(), docstring());
// also define sub-float counters
docstring const subtype = "sub-" + from_ascii(type);
counters_.newCounter(subtype, from_ascii(type),
"\\alph{" + subtype + "}", docstring());
}
return getout;
}
示例3: readTemplate
void Template::readTemplate(Lexer & lex)
{
enum {
TO_GUINAME = 1,
TO_HELPTEXT,
TO_INPUTFORMAT,
TO_FILTER,
TO_AUTOMATIC,
TO_PREVIEW,
TO_TRANSFORM,
TO_FORMAT,
TO_END
};
LexerKeyword templateoptiontags[] = {
{ "automaticproduction", TO_AUTOMATIC },
{ "filefilter", TO_FILTER },
{ "format", TO_FORMAT },
{ "guiname", TO_GUINAME },
{ "helptext", TO_HELPTEXT },
{ "inputformat", TO_INPUTFORMAT },
{ "preview", TO_PREVIEW },
{ "templateend", TO_END },
{ "transform", TO_TRANSFORM }
};
PushPopHelper pph(lex, templateoptiontags);
lex.setContext("Template::readTemplate");
string token;
while (lex.isOK()) {
switch (lex.lex()) {
case TO_GUINAME:
lex.next(true);
guiName = lex.getString();
break;
case TO_HELPTEXT:
helpText = lex.getLongString("HelpTextEnd");
break;
case TO_INPUTFORMAT:
lex.next(true);
inputFormat = lex.getString();
break;
case TO_FILTER:
lex.next(true);
fileRegExp = lex.getString();
break;
case TO_AUTOMATIC:
lex.next();
automaticProduction = lex.getBool();
break;
case TO_PREVIEW:
lex >> token;
if (token == "InstantPreview")
preview_mode = PREVIEW_INSTANT;
else if (token == "Graphics")
preview_mode = PREVIEW_GRAPHICS;
else
preview_mode = PREVIEW_OFF;
break;
case TO_TRANSFORM: {
lex >> token;
TransformID id = transformIDTranslator().find(token);
if (int(id) == -1)
LYXERR0("Transform " << token << " is not recognized");
else
transformIds.push_back(id);
break;
}
case TO_FORMAT:
lex.next(true);
formats[lex.getString()].readFormat(lex);
break;
case TO_END:
return;
default:
lex.printError("external::Template::readTemplate: "
"Wrong tag: $$Token");
LASSERT(false, /**/);
break;
}
}
}
示例4: read
//.........这里部分代码省略.........
}
break;
case TC_PAGESTYLE:
lexrc.next();
pagestyle_ = rtrim(lexrc.getString());
break;
case TC_DEFAULTFONT:
defaultfont_ = lyxRead(lexrc);
if (!defaultfont_.resolved()) {
lexrc.printError("Warning: defaultfont should "
"be fully instantiated!");
defaultfont_.realize(sane_font);
}
break;
case TC_SECNUMDEPTH:
lexrc.next();
secnumdepth_ = lexrc.getInteger();
break;
case TC_TOCDEPTH:
lexrc.next();
tocdepth_ = lexrc.getInteger();
break;
// First step to support options
case TC_CLASSOPTIONS:
readClassOptions(lexrc);
break;
case TC_PREAMBLE:
preamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_HTMLPREAMBLE:
htmlpreamble_ = from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_HTMLTOCSECTION:
html_toc_section_ = from_utf8(trim(lexrc.getString()));
break;
case TC_ADDTOPREAMBLE:
preamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_ADDTOHTMLPREAMBLE:
htmlpreamble_ += from_utf8(lexrc.getLongString("EndPreamble"));
break;
case TC_PROVIDES: {
lexrc.next();
string const feature = lexrc.getString();
lexrc.next();
if (lexrc.getInteger())
provides_.insert(feature);
else
provides_.erase(feature);
break;
}
case TC_REQUIRES: {
lexrc.eatLine();
vector<string> const req