aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/test/slime_value.h
blob: b2105ba0e044c0a2f0070e988ad8ff3f5de7bb66 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/data/slime/slime.h>
#include <cassert>

namespace search::docsummary::test {

/**
 * Utility class that wraps a slime object generated from json.
 */
struct SlimeValue {
    vespalib::Slime slime;

    SlimeValue(const vespalib::string& json_input)
        : slime()
    {
        size_t used = vespalib::slime::JsonFormat::decode(json_input, slime);
        assert(used > 0);
    }
};

}