Skip to content
Snippets Groups Projects
Commit 435e078d authored by Chris Burr's avatar Chris Burr
Browse files

Support writing ROOT files with LZ4 and ZSTD compression

parent 5981808a
No related branches found
No related tags found
1 merge request!1346Support writing ROOT files with LZ4 and ZSTD compression
......@@ -128,6 +128,12 @@ StatusCode RootConnectionSetup::setCompression( std::string_view compression ) {
alg_code = ROOT::kZLIB;
else if ( alg.size() == 4 && strncasecmp( alg.data(), "LZMA", 4 ) == 0 )
alg_code = ROOT::kLZMA;
else if ( alg.size() == 3 && strncasecmp( alg.data(), "LZ4", 3 ) == 0 )
alg_code = ROOT::kLZ4;
# if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 20, 0 )
else if ( alg.size() == 4 && strncasecmp( alg.data(), "ZSTD", 4 ) == 0 )
alg_code = ROOT::kZSTD;
# endif
else
throw runtime_error( "ERROR: request to set unknown ROOT compression algorithm:" + std::string{ alg } );
res = ::sscanf( std::string{ compression.substr( idx + 1 ) }.c_str(), "%d",
......
......@@ -37,6 +37,12 @@ RootHistCnv::RootCompressionSettings::RootCompressionSettings( const std::string
alg_code = ROOT::kZLIB;
} else if ( alg == "LZMA" ) {
alg_code = ROOT::kLZMA;
} else if ( alg == "LZ4" ) {
alg_code = ROOT::kLZ4;
#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 20, 0 )
} else if ( alg == "ZSTD" ) {
alg_code = ROOT::kZSTD;
#endif
} else {
throw std::runtime_error( "ERROR: Unknown ROOT compression algorithm:" + alg );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment