Coder Social home page Coder Social logo

franzliedke / compactstorage Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 18 KB

A C++ library for creating a compact bitstream made up of multiple different variables of variable length overlapping to save space.

License: GNU Lesser General Public License v2.1

C++ 100.00%

compactstorage's Introduction

compactstorage

A C++ library for creating a compact bitstream made up of multiple different variables of variable length and different types overlapping to save space.

This is especially useful in combination with techniques like QR codes, where it can be useful to decrease the space needed by data in order to keep the codes small.

License

This library is licensed under the GNU Lesser General Public License (LGPL).

Usage example

#include <iostream>

#include "compactstorage.h"

using namespace std;

int main(int argc, char** argv)
{
  CompactStorage storage;

  // Write data
  storage.writeBool(true);
  storage.writeBool(false);
  storage.writeInt(25, 7);
  
  // Display the compacted data
  storage.dump();
  
  // Read it again
  storage.reset();
  cout << storage.readBool() << endl;
  cout << storage.readBool() << endl;
  cout << storage.readInt(7) << endl;
  
  return 0;
}

compactstorage's People

Contributors

franzliedke avatar gguidini avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gguidini

compactstorage's Issues

Make sure integers are unsigned

Especially when dealing with booleans, I had some problems earlier with treating them as (signed) integers. I need to make sure integers are always treated as unsigned or, if they aren't, don't cause problems.

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.