//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// 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.1 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.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * バイナリライタヘッダ
 * @author Junpee
 */

#ifndef BINARY_WRITER_H_
#define BINARY_WRITER_H_

#include <Core/InputOutput/Writer.h>

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * バイナリライタ
 */
class BinaryWriter : public Writer{
public:
	/**
	 * デストラクタ
	 */
	virtual ~BinaryWriter();

	/**
	 * boolの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeBool(bool value);

	/**
	 * charの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeChar(char value);

	/**
	 * u_charの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeUChar(u_char value);

	/**
	 * shortの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeShort(short value);

	/**
	 * u_shortの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeUShort(u_short value);

	/**
	 * intの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeInt(int value);

	/**
	 * u_intの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeUInt(u_int value);

	/**
	 * floatの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeFloat(float value);

	/**
	 * doubleの書き出し
	 * @param value 書き出す値
	 */
	virtual void writeDouble(double value);

	/**
	 * Stringの書き出し
	 *
	 * Stringクラスをバイナリデータとして書き出します。
	 * @param string 書き出すString
	 */
	virtual void writeString(const String& string);

	/**
	 * 配列の書き出し
	 * @param array 書き出す配列
	 * @param elementSize 要素のサイズ
	 * @param elementCount 要素の数
	 */
	virtual void writeArray(
		const void* array, int elementSize, int elementCount);

protected:
	/**
	 * コンストラクタ
	 */
	BinaryWriter();

private:
};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of BINARY_WRITER_H_
//------------------------------------------------------------------------------
