---
name: "CL_OutputSource"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_OutputSource"
---

# CL\_OutputSource(3)

Interface to write data to different types of output sources.

## NAME

CL\_OutputSource - Interface to write data to different types of output sources.

## DESCRIPTION

CL\_OutputSource is used to write data to different types of input sources. In most cases, this is regular files and ClanLib zlib compressed datafiles.

To access some system specific output source types, such as datafiles and regular ones, use the static create functions in the CL\_OutputSourceProvider class.

## CLASS MEMBERS

- virtual **~CL\_OutputSource**()

  - virtual void **set\_system\_mode**()

  - virtual void **set\_big\_endian\_mode**()

  - virtual void **set\_little\_endian\_mode**()

  - virtual void **write\_int32**(

  ```
  int data)
  ```

- virtual void **write\_uint32**(

  ```
  unsigned int data)
  ```

- virtual void **write\_short16**(

  ```
  short data)
  ```

- virtual void **write\_ushort16**(

  ```
  unsigned short data)
  ```

- virtual void **write\_char8**(

  ```
  char data)
  ```

- virtual void **write\_uchar8**(

  ```
  unsigned char data)
  ```

- virtual void **write\_float32**(

  ```
  float data)
  ```

- virtual int **write**(

  ```
  const void *data,
  int size)
  ```

- virtual void **open**()

  - virtual void **close**()

  - virtual CL\_OutputSource \***clone**()

  - virtual int **tell**()

  - virtual int **size**()

  - virtual void **write\_string**(

  ```
  const char *string)
  ```

## MEMBERS WITH DESCRIPTIONS

- virtual **~CL\_OutputSource**()

  ```
  Description:
  ```

- virtual void **set\_system\_mode**()

  ```
  Description:
  ```

  Changes output data endianess to the local systems mode.

- virtual void **set\_big\_endian\_mode**()

  ```
  Description:
  ```

  Changes output data endianess to big endian mode.

- virtual void **set\_little\_endian\_mode**()

  ```
  Description:
  ```

  Changes output data endianess to little endian mode. This is the default setting.

- virtual void **write\_int32**(

  ```
  int data)
  ```

  ```
  Description:
  ```

  Writes a signed 32 bit integer to output source.

- virtual void **write\_uint32**(

  ```
  unsigned int data)
  ```

  ```
  Description:
  ```

  Writes a unsigned 32 bit integer to output source.

- virtual void **write\_short16**(

  ```
  short data)
  ```

  ```
  Description:
  ```

  Writes a signed 16 bit integer (short) to output source.

- virtual void **write\_ushort16**(

  ```
  unsigned short data)
  ```

  ```
  Description:
  ```

  Writes a unsigned 16 bit integer (short) to output source.

- virtual void **write\_char8**(

  ```
  char data)
  ```

  ```
  Description:
  ```

  Writes a signed 8 bit integer (char) to output source.

- virtual void **write\_uchar8**(

  ```
  unsigned char data)
  ```

  ```
  Description:
  ```

  Writes a unsigned 8 bit integer (char) to output source.

- virtual void **write\_float32**(

  ```
  float data)
  ```

  ```
  Description:
  ```

  Writes a ieee format floating point to output source.

- virtual int **write**(

  ```
  const void *data,
  int size)
  ```

  ```
  Parameters:
  data - Points to the array written.
  size - Number of bytes to write.
  ```

  ```
  Description:
  ```

  Writes larger amounts of data (no endian and 64 bit conversion):

  ```
  Return value:
  ```

  Num bytes actually written.

- virtual void **open**()

  ```
  Description:
  ```

  Opens the output source. By default, it is open.

- virtual void **close**()

  ```
  Description:
  ```

  Closes the output source.

- virtual CL\_OutputSource \***clone**()

  ```
  Description:
  ```

  Make a copy of the current OutputSource, standing at the same position.

  ```
  Return value:
  ```

  The copy of the output source.

- virtual int **tell**()

  ```
  Description:
  ```

  Returns current position in output source.

  ```
  Return value:
  ```

  Current position in source.

- virtual int **size**()

  ```
  Description:
  ```

  Returns the size of the output source

  ```
  Return value:
  ```

  Current size of output source.

- virtual void **write\_string**(

  ```
  const char *string)
  ```

  ```
  Description:
  ```

  Writes a string to the output source.

## SEE ALSO

- **CL\_OutputSourceProvider**

  Interface to open output sources with.

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
