Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
Compression.cxx
Go to the documentation of this file.
1// @(#)root/zip:$Id$
2// Author: David Dagenhart May 2011
3
4/*************************************************************************
5 * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "Compression.h"
13
14namespace ROOT {
15
16////////////////////////////////////////////////////////////////////////////////
17
19 {
20 if (compressionLevel < 0) compressionLevel = 0;
21 if (compressionLevel > 99) compressionLevel = 99;
22 int algo = algorithm;
24 return algo * 100 + compressionLevel;
25 }
26
28 {
29 switch (algorithm) {
30 case EAlgorithm::EValues::kZLIB: return "zlib";
31 case EAlgorithm::EValues::kLZMA: return "LZMA";
32 case EAlgorithm::EValues::kOldCompressionAlgo: return "Old compression algorithm";
33 case EAlgorithm::EValues::kLZ4: return "lz4";
34 case EAlgorithm::EValues::kZSTD: return "zstd";
35 default: return "Undefined compression algorithm";
36 }
37 }
38}
Small utility to parse cmdline options.
Definition RExports.h:71
int CompressionSettings(RCompressionSetting::EAlgorithm::EValues algorithm, int compressionLevel)
EValues
Note: this is only temporarily a struct and will become a enum class hence the name convention used.
Definition Compression.h:88
@ kOldCompressionAlgo
Use the old compression algorithm.
Definition Compression.h:99
@ kUndefined
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added).
static std::string AlgorithmToString(EAlgorithm::EValues algorithm)