Jpp 20.0.0-rc.8
the software that should make you happy
Loading...
Searching...
No Matches
JZip.hh
Go to the documentation of this file.
1#ifndef __JLANG_JZIP__
2#define __JLANG_JZIP__
3
4#include <zlib.h>
5
6/**
7 * \file
8 * gzip auxiliaries.
9 * \author mdejong
10 */
11namespace JLANG {}
12namespace JPP { using namespace JLANG; }
13
14namespace JLANG {
15
16 /**
17 * Check if file is gzipped.
18 *
19 * \param file_name file name
20 * \return true if gzipped; else false
21 */
22 inline bool is_gzipped(const char* const file_name)
23 {
24 gzFile fg = gzopen(file_name, "r");
25
26 const int result = gzdirect(fg);
27
28 gzclose(fg);
29
30 return result == 0;
31 }
32}
33
34#endif
Auxiliary classes and methods for language specific functionality.
bool is_gzipped(const char *const file_name)
Check if file is gzipped.
Definition JZip.hh:22
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).