JASSv2
Public Member Functions | Private Attributes | Friends | List of all members
JASS::file::file_read_only Class Reference

A read_only file object, the memory was probably allocated with mmap() and needs deallocating accordingly. More...

#include <file.h>

Public Member Functions

 file_read_only ()
 Constructor.
 
size_t open (const std::string &filename)
 Open and read the file into memory. More...
 
 ~file_read_only ()
 Destrucgtor.
 
size_t read_entire_file (const uint8_t *&into) const
 Return the contents and length of the file. More...
 

Private Attributes

const void * file_contents
 The contents of the file.
 
size_t size
 The size of the file.
 

Friends

class file
 

Detailed Description

A read_only file object, the memory was probably allocated with mmap() and needs deallocating accordingly.

Member Function Documentation

◆ open()

size_t JASS::file::file_read_only::open ( const std::string &  filename)

Open and read the file into memory.

Parameters
filename[in] The name of the file to read
Returns
The size of the file

◆ read_entire_file()

size_t JASS::file::file_read_only::read_entire_file ( const uint8_t *&  into) const
inline

Return the contents and length of the file.

Parameters
into[out] The pointer to write into.
Returns
The size of the file in bytes

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