commit
2b29bb1343
8 changed files with 61 additions and 23 deletions
@ -0,0 +1,14 @@ |
||||
#include "GzUtil.h" |
||||
|
||||
gzFile GzUtil::openPath(Path path, string flags) |
||||
{ |
||||
#ifdef WIN32 |
||||
wchar_t* wfilename = (wchar_t*)g_utf8_to_utf16(path.c_str(), -1, NULL, NULL, NULL); |
||||
gzFile fp = gzopen_w(wfilename, flags.c_str()); |
||||
g_free(wfilename); |
||||
|
||||
return fp; |
||||
#else |
||||
return gzopen(path.c_str(), flags.c_str()); |
||||
#endif |
||||
} |
||||
@ -0,0 +1,26 @@ |
||||
/*
|
||||
* Xournal++ |
||||
* |
||||
* Gzip Helper |
||||
* |
||||
* @author Xournal++ Team |
||||
* https://github.com/xournalpp/xournalpp
|
||||
* |
||||
* @license GNU GPLv2 or later |
||||
*/ |
||||
|
||||
#pragma once |
||||
|
||||
#include "Path.h" |
||||
#include <zlib.h> |
||||
|
||||
class GzUtil |
||||
{ |
||||
private: |
||||
GzUtil(); |
||||
virtual ~GzUtil(); |
||||
|
||||
public: |
||||
static gzFile openPath(Path path, string flags); |
||||
}; |
||||
|
||||
Loading…
Reference in new issue