aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/common/compressiontype.cpp
blob: e7a0ffceb5346b0092cefffc5189de9b528dfa1a (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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "compressiontype.h"

namespace config {

vespalib::string
compressionTypeToString(const CompressionType & compressionType)
{
    switch (compressionType) {
        case CompressionType::UNCOMPRESSED:
            return "UNCOMPRESSED";
        default:
            return "LZ4";
    }
}

CompressionType
stringToCompressionType(const vespalib::string & type)
{
    if (type.compare("UNCOMPRESSED") == 0) {
        return CompressionType::UNCOMPRESSED;
    } else {
        return CompressionType::LZ4;
    }
}

}