/*  $Id: outputsource.cpp,v 1.5 2003/07/20 22:30:53 grumbel Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  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
**
*/

#include "Core/precomp.h"
#include "API/Core/IOData/outputsource.h"

/////////////////////////////////////////////////////////////////////////////
// CL_OutputSource operations:

void CL_OutputSource::set_system_mode()
{
	little_endian_mode = true;
}

void CL_OutputSource::set_big_endian_mode()
{
	little_endian_mode = false;
}

void CL_OutputSource::set_little_endian_mode()
{
	little_endian_mode = true;
}

void CL_OutputSource::write_int64(cl_int64 data)
{
	write(&data, sizeof(cl_int64));
}

void CL_OutputSource::write_uint64(cl_uint64 data)
{
	write(&data, sizeof(cl_uint64));
}

void CL_OutputSource::write_int32(cl_int32 data)
{
	write(&data, sizeof(cl_int32));
}

void CL_OutputSource::write_uint32(cl_uint32 data)
{
	write(&data, sizeof(cl_uint32));
}

void CL_OutputSource::write_int16(cl_int16 data)
{
	write(&data, sizeof(cl_int16));
}

void CL_OutputSource::write_uint16(cl_uint16 data)
{
	write(&data, sizeof(cl_uint16));
}

void CL_OutputSource::write_int8(cl_int8 data)
{
	write(&data, sizeof(cl_int8));
}

void CL_OutputSource::write_uint8(cl_uint8 data)
{
	write(&data, sizeof(cl_uint8));
}

void CL_OutputSource::write_short16(short data)
{
	write(&data, sizeof(short));
}

void CL_OutputSource::write_ushort16(unsigned short data)
{
	write(&data, sizeof(unsigned short));
}

void CL_OutputSource::write_char8(char data)
{
	write(&data, sizeof(char));
}

void CL_OutputSource::write_uchar8(unsigned char data)
{
	write(&data, sizeof(unsigned char));
}

void CL_OutputSource::write_float32(float data)
{
	write(&data, sizeof(float));
}

void CL_OutputSource::write_bool8(bool data)
{
	write(&data, sizeof(bool));
}

void CL_OutputSource::write_string(const std::string &str)
{
	int size = str.length();
	write(&size, sizeof(int));
	write(str.data(), size);
}
