Code Monkey home page Code Monkey logo

bxzstr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bxzstr's Issues

config file name too generic?

I'm currently still using gzstream, but was looking for an updated interface and bxzstr looks pretty good!
However, the config.hpp file could potentially cause ambiguity depending on what the final include path looks like.
Would it be possible to rename as bxzstr_config.hpp (for example), to preclude any such problems (or did I miss something)?

Allow retrieving the decompressed size

It would be great to have a replacement function to calculate the uncompressed size. Usually people do something like that:

  bxz::ifstream is(filename, std::ios::binary);
  is.seekg (0, std::ios::end);
  length = UInt(is.tellg());
  is.seekg (0, std::ios::beg);

However with bxzstr seeking from end is not supported. However the decompressed size can be retrieved with ZSTD_getFrameContentSize for example (when using ZStd).
Are there any plans to add such a function

bxz::ofstream::close() produces a zero-byte file

When run with the code

#include "bxzstr.hpp"
#include <iostream>

int main(int argc, char** argv){
    bxz::ofstream out("test.gz", bxz::z, 1);
    for(long long i = 0; i < 10; i++){
        out << i << "\n";
    }
    out.close();
}

closing the file will not write anything (test.gz will be zero bytes). Flushing the stream and then closing will perform the write but using either separately fails.

Support for no exceptions?

Hi ๐Ÿ‘‹

When I try to compile this with exceptions turned off -fno-exceptions then it errors.

Is this an explicit decision, or could there be an option for having no exception support?

Zstd support fails for Zstd <= 1.5.0

The function ZSTD_defaultCLevel was not part of any release prior to v1.5.0 of Zstd, therefore:

/home/dmg/.cpm/bxzstr/d488119fdf94185eb9eaac489709a9e37dbe9c76/include/zstd_stream_wrapper.hpp:41:22: error: use of undeclared identifier 'ZSTD_defaultCLevel'; did you mean 'ZSTD_maxCLevel'?
                        const int level = ZSTD_defaultCLevel(), const int = 0)

Since Ubuntu 22.04 comes with ZStd 1.4.8 this seems like a reasonable thing to try and fix in the meantime

Support libdeflate?

See if libdeflate can be used in place of zlib when configured to do so. Libdeflate provides a more optimized implementation for DEFLATE than zlib (for some cases) but the API is not 1-to-1 compatible, so adding support might require some work.

plain_text support

when create bxz::ofstream, parameters as ("/tmp/test2.txt", std::ios_base::out, bxz::plaintext, 0),

" what(): Unrecognized compression type. " will be thrown.

Memory leaks

Hi @tmaklin ,

I run some simple codes under valgrind and see memory leaks originated in the bz_stream_wrapper.hpp and z_stream_wrapper.hpp. I have submitted an obvious fix #5 , but it seems it is not enough and one should actually have bz_stream::next_in = NULL; in the initialization. for all the cases.
But without a deeper knowledge of the code it is hard to judge.
Would you have a look?

Also, the z_stream_wrapper.hpp has the same issues.

Best regards,

Andrii

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.