TeaPacket v0.0.1
Multiplatform Game Engine
Loading...
Searching...
No Matches
AssetStream.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "Platform/Assets/PlatformAssetStream.hpp"
6
7namespace TeaPacket::Assets
8{
10 {
11 public:
13
14 PlatformAssetStream platformStream;
15
16 AssetStream(const std::string& path);
17 void ReadBytes(size_t length, char* data);
18 void Seek(ptrdiff_t amount, std::ios::seekdir dir);
19 size_t Tell();
20
21
22 void Skip(size_t length);
23
24 char ReadByte();
25 std::vector<char> ReadBytes(size_t length);
26
27 template<typename T>
29 {
30 T v;
31 ReadBytes(sizeof(T), reinterpret_cast<char*>(&v));
32 return v;
33 }
34
35
42
49
50 private:
51 void Pl_Initialize(const std::string& path);
52 void Pl_ReadBytes(size_t length, char* dest);
53 void Pl_Seek(ptrdiff_t amount, std::ios::seekdir dir);
54 size_t Pl_Tell();
55 };
56}
PlatformAssetStream platformStream
Definition AssetStream.hpp:14
void ReadBytes(size_t length, char *data)
AssetStream(const std::string &path)
void Seek(ptrdiff_t amount, std::ios::seekdir dir)
void Skip(size_t length)
bool endOfField
Definition AssetStream.hpp:12
T ReadVal()
Definition AssetStream.hpp:28
std::vector< char > ReadBytes(size_t length)
Functionality relating to files.
Definition AssetReader.hpp:7