mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Comentários em BinaryWriter
This commit is contained in:
parent
ebcb31d9a7
commit
0f9c710b71
@ -84,11 +84,21 @@ namespace xna {
|
|||||||
//A simplified port of the BinaryWriter class.
|
//A simplified port of the BinaryWriter class.
|
||||||
class BinaryWriter {
|
class BinaryWriter {
|
||||||
public:
|
public:
|
||||||
BinaryWriter(sptr<Stream> const& stream) : _stream(stream), _buffer(16) {
|
BinaryWriter(sptr<Stream> const& stream) {
|
||||||
|
if (!stream)
|
||||||
|
throw std::invalid_argument("stream is null.");
|
||||||
|
|
||||||
|
_stream = stream;
|
||||||
|
_buffer = std::vector<Byte>(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Sets the position within the current stream.
|
||||||
Long Seek(Int offset, SeekOrigin origin);
|
Long Seek(Int offset, SeekOrigin origin);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Writes a value to the current stream.
|
||||||
|
//
|
||||||
|
|
||||||
void Write(bool value);
|
void Write(bool value);
|
||||||
void Write(Byte value);
|
void Write(Byte value);
|
||||||
void Write(Sbyte value);
|
void Write(Sbyte value);
|
||||||
@ -108,12 +118,14 @@ namespace xna {
|
|||||||
void Write(std::string const& value);
|
void Write(std::string const& value);
|
||||||
void Write(const char* _string, size_t stringLength);
|
void Write(const char* _string, size_t stringLength);
|
||||||
|
|
||||||
public:
|
//Writes a 32-bit integer in a compressed format.
|
||||||
sptr<Stream> _stream = nullptr;
|
void Write7BitEncodedInt(Int value);
|
||||||
|
|
||||||
|
//void Write7BitEncodedInt64(Long value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
sptr<Stream> _stream = nullptr;
|
||||||
std::vector<Byte> _buffer;
|
std::vector<Byte> _buffer;
|
||||||
void Write7BitEncodedInt(Int value);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user