| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

File.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "Resource.h"
4
5 #include <fstream>
6 #include <vector>
7
8 namespace Fling
9 {
13 class File : public Resource
14 {
15 public:
16
17 static std::shared_ptr<Fling::File> Create(Guid t_ID);
18
24 explicit File(Guid t_ID);
25
31 const char* GetData() const { return m_Characters.data(); }
32
38 size_t GetFileLength() const { return m_Characters.size(); }
39
43 bool IsLoaded() const { return m_Characters.size() != 0; }
44
45 private:
46
52 void LoadFile();
53
55 std::vector<char> m_Characters;
56 };
57 } // namespace Fling
Fling::File::LoadFile
void LoadFile()
Loads the file based on Guid path.
Definition: File.cpp:18
Fling::Resource
Base class that represents a loaded resource in the engine.
Definition: Resource.h:11
Fling::File::IsLoaded
bool IsLoaded() const
Returns true if this file resource is loaded or not (i.e.
Definition: File.h:43
Resource.h
Fling::Guid
entt::hashed_string Guid
Definition: FlingTypes.h:26
Fling::File::File
File(Guid t_ID)
Construct a new File object.
Definition: File.cpp:12
Fling::File::GetData
const char * GetData() const
Get char* that represents the text in this file.
Definition: File.h:31
Fling::File::m_Characters
std::vector< char > m_Characters
Array of characters that represents this file.
Definition: File.h:55
Fling::File::Create
static std::shared_ptr< Fling::File > Create(Guid t_ID)
Definition: File.cpp:7
Fling
Definition: Engine.h:29
Fling::File
A file is a basic text file that contains a basic text file.
Definition: File.h:13
Fling::File::GetFileLength
size_t GetFileLength() const
Get the File Length object.
Definition: File.h:38