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 
22  explicit File(Guid t_ID);
23 
29  const char* GetData() const { return m_Characters.data(); }
30 
36  size_t GetFileLength() const { return m_Characters.size(); }
37 
41  bool IsLoaded() const { return m_Characters.size() != 0; }
42 
43  private:
44 
50  void LoadFile();
51 
53  std::vector<char> m_Characters;
54  };
55 } // namespace Fling
void LoadFile()
Loads the file based on Guid path.
Definition: File.cpp:12
Base class that represents a loaded resource in the engine.
Definition: Resource.h:11
bool IsLoaded() const
Returns true if this file resource is loaded or not (i.e.
Definition: File.h:41
entt::hashed_string Guid
Definition: FlingTypes.h:21
File(Guid t_ID)
Construct a new File object.
Definition: File.cpp:6
const char * GetData() const
Get char* that represents the text in this file.
Definition: File.h:29
std::vector< char > m_Characters
Array of characters that represents this file.
Definition: File.h:53
Definition: Engine.h:13
A file is a basic text file that contains a basic text file.
Definition: File.h:13
size_t GetFileLength() const
Get the File Length object.
Definition: File.h:36