btool
A parser/converter/transpiler for .bib files
▼
btool
►
Classes
▼
Files
▼
File List
▼
src
AbstractGenerator.cpp
►
AbstractGenerator.hpp
AbstractParserState.cpp
►
AbstractParserState.hpp
►
BibElement.cpp
►
BibElement.hpp
►
Field.cpp
►
Field.hpp
►
Generator.hpp
GeneratorException.cpp
►
GeneratorException.hpp
GlobalParserState.cpp
►
GlobalParserState.hpp
HtmlGenerator.cpp
►
HtmlGenerator.hpp
IdentifierParserState.cpp
►
IdentifierParserState.hpp
KeyParserState.cpp
►
KeyParserState.hpp
Parser.cpp
►
Parser.hpp
ParserContext.cpp
►
ParserContext.hpp
ParserException.cpp
►
ParserException.hpp
►
ParserState.hpp
PlainTextGenerator.cpp
►
PlainTextGenerator.hpp
StyleParserState.cpp
►
StyleParserState.hpp
StyleProperties.cpp
►
StyleProperties.hpp
TranslationTable.cpp
►
TranslationTable.hpp
ValueParserState.cpp
►
ValueParserState.hpp
XmlGenerator.cpp
►
XmlGenerator.hpp
►
test
►
main.cpp
►
File Members
►
Examples
•
All
Classes
Files
Functions
Variables
Enumerations
Enumerator
StyleParserState.cpp
Go to the documentation of this file.
1
#include <
StyleParserState.hpp
>
2
#include <boost/algorithm/string.hpp>
3
#include <
IdentifierParserState.hpp
>
4
#include <string>
5
#include <cctype>
6
7
using namespace
std::literals::string_literals;
8
14
StyleParserState::StyleParserState
(
ParserContext
&context, std::vector<BibElement> &result) noexcept
15
:
AbstractParserState
{context, result} {}
16
23
auto
StyleParserState::handleCharacter
(
const
char
c) ->
ParserState
* {
24
if
(c ==
'{'
) {
25
if
(style.empty()) {
26
fail(
"Style-Name must not be empty"
s);
27
}
else
{
28
result.push_back({
""
, boost::trim_copy(style), {}});
29
const
auto
identifierState =
new
IdentifierParserState
{context, result};
30
delete
this
;
31
return
identifierState;
32
}
33
}
else
if
(std::isgraph(c)) {
34
style += c;
35
return
this
;
36
}
else
{
37
fail(
"Invalid Character in Style-Name, got so far: ["
s + style +
"]"
s);
38
}
39
}
StyleParserState::handleCharacter
auto handleCharacter(char c) -> ParserState *override
Definition:
StyleParserState.cpp:23
ParserState
Definition:
ParserState.hpp:7
AbstractParserState
Definition:
AbstractParserState.hpp:13
ParserContext
Definition:
ParserContext.hpp:10
IdentifierParserState
Identifier Parser State.
Definition:
IdentifierParserState.hpp:14
StyleParserState.hpp
StyleParserState::StyleParserState
StyleParserState(ParserContext &context, std::vector< BibElement > &result) noexcept
Definition:
StyleParserState.cpp:14
IdentifierParserState.hpp
src
StyleParserState.cpp
Generated by
1.8.19