/* -*- mode:c++; coding: koi8-r -*- */

#ifndef __BitSource_hpp__
#define __BitSource_hpp__

/* $Id: BitSource.hpp,v 1.1 2003/04/14 19:37:57 cher Exp $ */
/* Copyright (C) 2003 Alexander Chernov <cher@unicorn.cmc.msu.ru> */

/*
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 See the `COPYING' file for the full terms and conditions.
*/

#include "ByteSource.hpp"
#include "ReadError.hpp"
#include "BadArgsError.hpp"

class BitSource
{
  ByteSource *src;
  int bits_stored;
  unsigned char bits;

public:
  BitSource(ByteSource *) throw (BadArgsError);
  ~BitSource() throw();

  void read(int n, void *ptr, int offset) throw (ReadError,BadArgsError);
};

#endif /* __BitSource_hpp__ */

/*
 * Local variables:
 *  compile-command: "make -C .."
 *  c++-font-lock-extra-types: ("[A-Z]\\sw*[a-z]\\sw*")
 * End:
 */
