Blame lib/bititerator.hpp

rpm-build d2b433
/* -*- tab-width:4; c-basic-offset:4 -*- */
rpm-build d2b433
/*
rpm-build d2b433
 * libopenraw - bititerator.cpp
rpm-build d2b433
 *
rpm-build d2b433
 * Copyright (C) 2008 Rafael Avila de Espindola.
rpm-build d2b433
 *
rpm-build d2b433
 * This library is free software: you can redistribute it and/or
rpm-build d2b433
 * modify it under the terms of the GNU Lesser General Public License
rpm-build d2b433
 * as published by the Free Software Foundation, either version 3 of
rpm-build d2b433
 * the License, or (at your option) any later version.
rpm-build d2b433
 *
rpm-build d2b433
 * This library is distributed in the hope that it will be useful,
rpm-build d2b433
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build d2b433
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rpm-build d2b433
 * Lesser General Public License for more details.
rpm-build d2b433
 *
rpm-build d2b433
 * You should have received a copy of the GNU Lesser General Public
rpm-build d2b433
 * License along with this library.  If not, see
rpm-build d2b433
 * <http://www.gnu.org/licenses/>.
rpm-build d2b433
 */
rpm-build d2b433
rpm-build d2b433
#ifndef OR_INTERNAL_BITITERATOR_H_
rpm-build d2b433
#define OR_INTERNAL_BITITERATOR_H_
rpm-build d2b433
rpm-build d2b433
#include <stdint.h>
rpm-build d2b433
#include <stddef.h>
rpm-build d2b433
rpm-build d2b433
namespace OpenRaw {
rpm-build d2b433
namespace Internals {
rpm-build d2b433
rpm-build d2b433
class BitIterator {
rpm-build d2b433
    const uint8_t* m_p;
rpm-build d2b433
    size_t m_size;
rpm-build d2b433
rpm-build d2b433
    uint32_t m_bitBuffer;
rpm-build d2b433
    size_t m_bitsOnBuffer;
rpm-build d2b433
    void load(size_t numBits);
rpm-build d2b433
rpm-build d2b433
public:
rpm-build d2b433
    BitIterator(const uint8_t *p, size_t s);
rpm-build d2b433
    uint32_t get(size_t);
rpm-build d2b433
    uint32_t peek(size_t);
rpm-build d2b433
    void skip(size_t);
rpm-build d2b433
};
rpm-build d2b433
rpm-build d2b433
}
rpm-build d2b433
}
rpm-build d2b433
rpm-build d2b433
#endif