blob: 4c1ee66050226c355c0daa67fcdeab110f056fa2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "objectvisitor.h"
#include <vector>
namespace vespalib {
namespace slime { class Cursor; }
/**
* This is a concrete object visitor that will build up a structured
* slime representation of an object.
**/
class Object2Slime : public ObjectVisitor
{
private:
std::reference_wrapper<slime::Cursor> _cursor;
std::vector<std::reference_wrapper<slime::Cursor>> _stack;
public:
Object2Slime(slime::Cursor & cursor);
~Object2Slime();
void openStruct(const vespalib::string &name, const vespalib::string &type) override;
void closeStruct() override;
void visitBool(const vespalib::string &name, bool value) override;
void visitInt(const vespalib::string &name, int64_t value) override;
void visitFloat(const vespalib::string &name, double value) override;
void visitString(const vespalib::string &name, const vespalib::string &value) override;
void visitNull(const vespalib::string &name) override;
void visitNotImplemented() override;
};
} // namespace vespalib
|