mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Provide optional trimmed version of Lexer::getString and getDocString
Prerequisite to fix #9518
This commit is contained in:
parent
2f80c1ca33
commit
f0bb9b32d1
@ -695,23 +695,23 @@ double Lexer::getFloat() const
|
||||
}
|
||||
|
||||
|
||||
string const Lexer::getString() const
|
||||
string const Lexer::getString(bool trim) const
|
||||
{
|
||||
lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
|
||||
|
||||
if (lastReadOk_)
|
||||
return pimpl_->getString();
|
||||
return trim ? support::trim(pimpl_->getString(), "\t ") : pimpl_->getString();
|
||||
|
||||
return string();
|
||||
}
|
||||
|
||||
|
||||
docstring const Lexer::getDocString() const
|
||||
docstring const Lexer::getDocString(bool trim) const
|
||||
{
|
||||
lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
|
||||
|
||||
if (lastReadOk_)
|
||||
return pimpl_->getDocString();
|
||||
return trim ? support::trim(pimpl_->getDocString(), "\t ") : pimpl_->getDocString();
|
||||
|
||||
return docstring();
|
||||
}
|
||||
|
@ -137,9 +137,9 @@ public:
|
||||
///
|
||||
double getFloat() const;
|
||||
///
|
||||
std::string const getString() const;
|
||||
std::string const getString(bool trim = false) const;
|
||||
///
|
||||
docstring const getDocString() const;
|
||||
docstring const getDocString(bool trim = false) const;
|
||||
/** Get a long string, ended by the tag `endtag'.
|
||||
This string can span several lines. The first line
|
||||
serves as a template for how many spaces the lines
|
||||
|
Loading…
Reference in New Issue
Block a user