Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Public Member Functions | Public Attributes | Private Attributes | List of all members
cqsp::asset::NativeFile Class Reference

#include <nativevfs.h>

Inheritance diagram for cqsp::asset::NativeFile:
cqsp::asset::IVirtualFile

Public Member Functions

 NativeFile (NativeFileSystem *_nfs)
 
 NativeFile (NativeFileSystem *_nfs, const std::string &file)
 
 ~NativeFile ()
 
const std::string & Path () override
 Get file path relative to the filesystem. More...
 
uint64_t Size () override
 Size of file in bytes More...
 
void Read (uint8_t *buffer, int bytes) override
 Reads num_bytes of bytes into buffer. Frees memory for the number More...
 
bool Seek (long offset, Offset origin) override
 Goto position of file, offset away from origin More...
 
uint64_t Tell () override
 Get current file position More...
 
IVirtualFileSystemGetFileSystem () override
 
- Public Member Functions inherited from cqsp::asset::IVirtualFile
 IVirtualFile ()
 
virtual ~IVirtualFile ()
 

Public Attributes

friend NativeFileSystem
 

Private Attributes

std::string path
 
std::ifstream file
 
int size
 
NativeFileSystem *const nfs
 

Constructor & Destructor Documentation

◆ NativeFile() [1/2]

cqsp::asset::NativeFile::NativeFile ( NativeFileSystem _nfs)
inlineexplicit

◆ NativeFile() [2/2]

cqsp::asset::NativeFile::NativeFile ( NativeFileSystem _nfs,
const std::string &  file 
)
inline

◆ ~NativeFile()

cqsp::asset::NativeFile::~NativeFile ( )
inline

Member Function Documentation

◆ GetFileSystem()

IVirtualFileSystem * cqsp::asset::NativeFile::GetFileSystem ( )
inlineoverridevirtual

◆ Path()

const std::string & cqsp::asset::NativeFile::Path ( )
overridevirtual

Get file path relative to the filesystem.

Implements cqsp::asset::IVirtualFile.

◆ Read()

void cqsp::asset::NativeFile::Read ( uint8_t *  buffer,
int  num_bytes 
)
overridevirtual

Reads num_bytes of bytes into buffer. Frees memory for the number

Parameters
buffer
num_bytes

Implements cqsp::asset::IVirtualFile.

◆ Seek()

bool cqsp::asset::NativeFile::Seek ( long  offset,
Offset  origin 
)
overridevirtual

Goto position of file, offset away from origin

Implements cqsp::asset::IVirtualFile.

◆ Size()

uint64_t cqsp::asset::NativeFile::Size ( )
overridevirtual

Size of file in bytes

Implements cqsp::asset::IVirtualFile.

◆ Tell()

uint64_t cqsp::asset::NativeFile::Tell ( )
overridevirtual

Get current file position

Implements cqsp::asset::IVirtualFile.

Member Data Documentation

◆ file

std::ifstream cqsp::asset::NativeFile::file
private

◆ NativeFileSystem

friend cqsp::asset::NativeFile::NativeFileSystem

◆ nfs

NativeFileSystem* const cqsp::asset::NativeFile::nfs
private

◆ path

std::string cqsp::asset::NativeFile::path
private

◆ size

int cqsp::asset::NativeFile::size
private

The documentation for this class was generated from the following files: