mirror of
https://github.com/Halofreak1990/XFXFramework
synced 2024-12-26 13:49:34 +01:00
TextureCollection is broken because it can somehow not resolve Texture as template argument for the List it uses. Added missing BinaryWriter and TextWriter classes to System::IO namespace Modified BinaryReader Added PacketReader and PacketWriter classes to XFX::Net namespace
68 lines
1.7 KiB
C++
68 lines
1.7 KiB
C++
#ifndef _SYSTEM_IO_BINARYWRITER_
|
|
#define _SYSTEM_IO_BINARYWRITER_
|
|
|
|
#include <System/Types.h>
|
|
#include <System/Interfaces.h>
|
|
#include <System/Text/Encoding.h>
|
|
#include "Stream.h"
|
|
|
|
using namespace System::Text;
|
|
|
|
namespace System
|
|
{
|
|
namespace IO
|
|
{
|
|
/// <summary>
|
|
/// Writes primitive types in binary to a stream and supports writing strings in a specific encoding.
|
|
/// </summary>
|
|
class BinaryWriter : public IDisposable, virtual Object
|
|
{
|
|
private:
|
|
byte* _buffer;
|
|
Encoder _encoder;
|
|
Encoding _encoding;
|
|
byte* _largeByteBuffer;
|
|
int _maxChars;
|
|
char* _tmpOneCharBuffer;
|
|
static const int LargeByteBufferSize;
|
|
|
|
protected:
|
|
Stream* OutStream;
|
|
BinaryWriter();
|
|
|
|
virtual void Dispose(bool disposing);
|
|
void Write7BiteEncodedInt(int value);
|
|
|
|
public:
|
|
static const BinaryWriter Null;
|
|
virtual Stream* BaseStream();
|
|
|
|
BinaryWriter(Stream* output);
|
|
BinaryWriter(Stream* output, Encoding encoding);
|
|
|
|
virtual void Close();
|
|
void Dispose();
|
|
virtual void Flush();
|
|
virtual Int64 Seek(int offset, SeekOrigin_t origin);
|
|
virtual void Write(bool value);
|
|
virtual void Write(byte value);
|
|
virtual void Write(byte* value);
|
|
virtual void Write(sbyte value);
|
|
virtual void Write(char ch);
|
|
virtual void Write(double value);
|
|
virtual void Write(short value);
|
|
virtual void Write(int value);
|
|
virtual void Write(Int64 value);
|
|
virtual void Write(float value);
|
|
virtual void Write(char* value);
|
|
virtual void Write(ushort value);
|
|
virtual void Write(uint value);
|
|
virtual void Write(ulong value);
|
|
virtual void Write(byte* buffer, int index, int count);
|
|
virtual void Write(char chars[], int index, int count);
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif //_SYSTEM_IO_BINARYWRITER_
|