- Cal3D 0.11 API Reference -

buffersource.h
1//****************************************************************************//
2// buffersource.h //
3// Copyright (C) 2001-2003 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_BUFFERSOURCE_H
12#define CAL_BUFFERSOURCE_H
13
14//****************************************************************************//
15// Includes //
16//****************************************************************************//
17
18#include "cal3d/global.h"
19#include "cal3d/datasource.h"
20#include <istream>
21
28
29
30class CAL3D_API CalBufferSource : public CalDataSource
31{
32public:
33 CalBufferSource(void *inputBuffer);
34 virtual ~CalBufferSource();
35
36 virtual bool ok() const;
37 virtual void setError() const;
38 virtual bool readBytes(void *pBuffer, int length);
39 virtual bool readFloat(float& value);
40 virtual bool readShort(short& value);
41 virtual bool readInteger(int& value);
42 virtual bool readString(std::string& strValue);
43
44protected:
45
46 void *mInputBuffer;
47 unsigned int mOffset;
48
49private:
50 CalBufferSource(); //Can't use this
51};
52
53#endif
CalBufferSource(void *inputBuffer)
Constructs a buffer source instance from an existing memory buffer.
Definition buffersource.cpp:30
virtual bool ok() const
Checks whether the data source is in a good state.
Definition buffersource.cpp:56
virtual bool readFloat(float &value)
Reads a float.
Definition buffersource.cpp:110
virtual bool readShort(short &value)
Reads a short.
Definition buffersource.cpp:133
virtual bool readInteger(int &value)
Reads an integer.
Definition buffersource.cpp:156
virtual bool readString(std::string &strValue)
Reads a string.
Definition buffersource.cpp:179
virtual bool readBytes(void *pBuffer, int length)
Reads a number of bytes.
Definition buffersource.cpp:87
virtual void setError() const
Sets the error code and message related to a memory buffer source.
Definition buffersource.cpp:69
CalDataSource abstract interface class.
Definition datasource.h:31

Generated by The Cal3D Team with Doxygen 1.13.2