Giter Club home page Giter Club logo

micropak's Introduction

Micropak, a basic library for archiving files
Written by hippo_o_matic

Dependencies:
- meson
- zlib (optionally)
- cmake (optionally)

Building:

mkdir build
meson build
ninja -C build


To use include micropak.hpp in your source and link libmicropak.so (-lmicropak in g++)


All commands are stored under the "micropak" namespace, these include:

micropak::pack(std::string input_directory, std::string output_file, bool compress, std::vector<meta_entry>);
Packs the <input_directory> into an <output_file>, by default the directory's name. Also takes a vector of meta entries, which are pairs of values
you can store right in the archive. 

Example of a meta entry:
{name, value} | {"Author", "hippo"}

micropak::unpack(std::string input_file, std::string output_dir);
Unpacks the <input_file> to <output_dir>, by default the working directory. Returns a vector of meta_entries found

micropak::getVersion(std::string filename); | micropak::getVersion(std::fstream &stream);
Gets the version of the library the archive was packed with


This library includes support for compressing and decompressing archives on the fly using gzip-hpp (https://github.com/mapbox/gzip-hpp) made by mapbox. You can toggle the use of gzip-hpp by setting the option 'use_gzip' either in meson_options.txt or by configuring the project like so:

meson configure -Doption=newvalue

This repo also comes with a minimalist example program, demo.cpp. 

Program usage: ./archiver <options>
-p <directory> 	                | Recursively packs all files in <directory> to -o <file>. Uses <directory>.mpak if -o <file> not given
-u <file> 			            | Unpacks an archive, <file>, using -o <directory> as it's root. Uses <file> as the name if -o <directory> not given
-o <file/directory>             | Outputs the result of -p or -u to <file/directory>
-m <name=content,name=content>  | Attaches given meta tag pairs, the name and content of each tag seperated by '=', and each pair seperated by ','
-v					            | Enables verbose mode, reports back what is being done for debugging purposes
--no-gzip 			            | Packs a file without gzipping it
-h, --help 		                | Displays this message :)"

micropak's People

Contributors

u1f98e avatar

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.