aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/fieldvalue/rawfieldvalue.cpp
blob: c9950036435d58b074754f4b9b7fce7ac1693e23 (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "rawfieldvalue.h"
#include "literalfieldvalue.hpp"
#include <vespa/document/util/stringutil.h>
#include <vespa/vespalib/util/xmlstream.h>

using namespace vespalib::xml;

namespace document {

IMPLEMENT_IDENTIFIABLE(RawFieldValue, LiteralFieldValueB);

void
RawFieldValue::printXml(XmlOutputStream& out) const
{
    out << XmlBase64Content()
        << XmlContentWrapper(_value.c_str(), _value.size());
}

void
RawFieldValue::print(std::ostream& out, bool, const std::string&) const
{
    StringUtil::printAsHex(out, _value.c_str(), _value.size());
}

} // document