Blame lib/unpack.hpp

rpm-build d2b433
/*
rpm-build d2b433
 * libopenraw - unpack.h
rpm-build d2b433
 *
rpm-build d2b433
 * Copyright (C) 2008-2013 Hubert Figuiere
rpm-build d2b433
 * Copyright (C) 2008 Novell, Inc.
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
rpm-build d2b433
#ifndef OR_INTERNALS_UNPACK_H_
rpm-build d2b433
#define OR_INTERNALS_UNPACK_H_
rpm-build d2b433
rpm-build d2b433
#include <stdint.h>
rpm-build d2b433
#include <stddef.h>
rpm-build d2b433
rpm-build d2b433
#include <libopenraw/consts.h>
rpm-build d2b433
rpm-build d2b433
namespace OpenRaw {	namespace Internals {
rpm-build d2b433
rpm-build d2b433
	/** Unpack class. Because we need to maintain a state */
rpm-build d2b433
	class Unpack
rpm-build d2b433
	{
rpm-build d2b433
	public:
rpm-build d2b433
		Unpack(uint32_t w, uint32_t t);
rpm-build d2b433
		// noncopyable
rpm-build d2b433
		Unpack(const Unpack&) = delete;
rpm-build d2b433
		Unpack & operator=(const Unpack&) = delete;
rpm-build d2b433
rpm-build d2b433
		size_t block_size();
rpm-build d2b433
		or_error unpack_be12to16(uint8_t *dest, size_t destsize, const uint8_t *src, size_t size, size_t & outsize);
rpm-build d2b433
	private:
rpm-build d2b433
		uint32_t m_w;
rpm-build d2b433
		uint32_t m_type;
rpm-build d2b433
	};
rpm-build d2b433
rpm-build d2b433
} }
rpm-build d2b433
rpm-build d2b433
#endif