MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / create

Method create

src/hx/zip/zlib/ZLibCompress.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#define ZLIB_OBJ_CLOSED ::hx::Throw(HX_CSTRING("Compress closed"))
8
9hx::zip::Compress hx::zip::Compress_obj::create(int level)
10{
11 auto handle = std::unique_ptr<z_stream>(new z_stream());
12 auto error = deflateInit(handle.get(), level);
13
14 if (error != Z_OK)
15 {
16 hx::Throw(HX_CSTRING("ZLib Error"));
17 }
18
19 return new hx::zip::zlib::ZLibCompress(handle.release());
20}
21
22Array<uint8_t> hx::zip::Compress_obj::run(cpp::marshal::View<uint8_t> src, int level)
23{

Callers

nothing calls this directly

Calls 3

ThrowFunction · 0.85
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected