1 #ifndef TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 #define TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 4 #if defined(_MSC_VER) || \ 5 (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 10 #include "yaml-cpp/mark.h" 16 const std::string TokenNames[] = {
17 "DIRECTIVE",
"DOC_START",
"DOC_END",
"BLOCK_SEQ_START",
18 "BLOCK_MAP_START",
"BLOCK_SEQ_END",
"BLOCK_MAP_END",
"BLOCK_ENTRY",
19 "FLOW_SEQ_START",
"FLOW_MAP_START",
"FLOW_SEQ_END",
"FLOW_MAP_END",
20 "FLOW_MAP_COMPACT",
"FLOW_ENTRY",
"KEY",
"VALUE",
21 "ANCHOR",
"ALIAS",
"TAG",
"SCALAR"};
25 enum STATUS { VALID, INVALID, UNVERIFIED };
51 Token(TYPE type_,
const Mark& mark_)
52 : status(VALID), type(type_), mark(mark_), value{}, params{}, data(0) {}
54 friend std::ostream&
operator<<(std::ostream& out,
const Token& token) {
55 out << TokenNames[token.type] << std::string(
": ") << token.value;
56 for (
const std::string& param : token.params)
57 out << std::string(
" ") << param;
65 std::vector<std::string> params;
70 #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 JSON_API OStream & operator<<(OStream &, const Value &root)
Output using the StyledStreamWriter.