libragephoto Version: 0.1.0
|
GTA V and RDR 2 Photo Parser. More...
#include <RagePhoto.h>
Public Member Functions | |
void | clear () |
RagePhotoData * | data () |
bool | load (const char *data, size_t size) |
bool | load (const std::string &data) |
bool | loadFile (const std::string &filename) |
uint8_t | error () const |
uint32_t | format () const |
const std::string | photo () const |
const char * | photoData () const |
uint32_t | photoSize () const |
const std::string & | description () const |
const std::string & | json () const |
const std::string & | header () const |
const std::string & | title () const |
bool | save (char *data, uint32_t photoFormat) |
bool | save (char *data) |
const std::string | save (uint32_t photoFormat, bool *ok=nullptr) |
const std::string | save (bool *ok=nullptr) |
bool | saveFile (const std::string &filename, uint32_t photoFormat) |
bool | saveFile (const std::string &filename) |
size_t | saveSize (uint32_t photoFormat) |
size_t | saveSize () |
void | setBufferDefault () |
void | setBufferOffsets () |
void | setDescription (const std::string &description, uint32_t bufferSize=0) |
void | setFormat (uint32_t photoFormat) |
void | setFormatLoadFunction (uint32_t photoFormat, RagePhotoLoadFunc func) |
void | setJson (const std::string &json, uint32_t bufferSize=0) |
void | setHeader (const std::string &header, uint32_t headerSum) |
bool | setPhoto (const char *data, uint32_t size, uint32_t bufferSize=0) |
bool | setPhoto (const std::string &data, uint32_t bufferSize=0) |
void | setTitle (const std::string &title, uint32_t bufferSize=0) |
Static Public Member Functions | |
static const char * | version () |
static size_t | saveSize (RagePhotoData *ragePhotoData, uint32_t photoFormat) |
static size_t | saveSize (RagePhotoData *ragePhotoData) |
static void | setBufferDefault (RagePhotoData *ragePhotoData) |
static void | setBufferOffsets (RagePhotoData *ragePhotoData) |
GTA V and RDR 2 Photo Parser.
enum RagePhoto::DefaultSize : uint32_t |
Default sizes
enum RagePhoto::Error : uint8_t |
Parsing and set errors
enum RagePhoto::PhotoFormat : uint32_t |
void RagePhoto::clear | ( | ) |
Resets the RagePhoto instance to default values.
RagePhotoData * RagePhoto::data | ( | ) |
Returns the internal RagePhotoData object.
const std::string & RagePhoto::description | ( | ) | const |
Returns the Photo description.
uint8_t RagePhoto::error | ( | ) | const |
Returns the last error occurred.
uint32_t RagePhoto::format | ( | ) | const |
Returns the Photo Format (GTA V or RDR 2).
const std::string & RagePhoto::header | ( | ) | const |
Returns the Photo header.
const std::string & RagePhoto::json | ( | ) | const |
Returns the Photo JSON data.
bool RagePhoto::load | ( | const char * | data, |
size_t | size | ||
) |
Loads a Photo from a const char*.
data | Photo data |
size | Photo data size |
bool RagePhoto::load | ( | const std::string & | data | ) |
Loads a Photo from a std::string.
data | Photo data |
bool RagePhoto::loadFile | ( | const std::string & | filename | ) |
Loads a Photo from a file.
filename | File to load |
const std::string RagePhoto::photo | ( | ) | const |
Returns the Photo JPEG data.
const char * RagePhoto::photoData | ( | ) | const |
Returns the Photo JPEG data.
uint32_t RagePhoto::photoSize | ( | ) | const |
Returns the Photo JPEG data size.
const std::string RagePhoto::save | ( | bool * | ok = nullptr | ) |
Saves a Photo to a std::string.
ok | true when saved successfully |
bool RagePhoto::save | ( | char * | data | ) |
Saves a Photo to a char*.
data | Photo data |
bool RagePhoto::save | ( | char * | data, |
uint32_t | photoFormat | ||
) |
Saves a Photo to a char*.
data | Photo data |
photoFormat | Photo Format (GTA V or RDR 2) |
const std::string RagePhoto::save | ( | uint32_t | photoFormat, |
bool * | ok = nullptr |
||
) |
Saves a Photo to a std::string.
photoFormat | Photo Format (GTA V or RDR 2) |
ok | true when saved successfully |
bool RagePhoto::saveFile | ( | const std::string & | filename | ) |
Saves a Photo to a file.
bool RagePhoto::saveFile | ( | const std::string & | filename, |
uint32_t | photoFormat | ||
) |
Saves a Photo to a file.
|
inline |
Returns the Photo save file size.
|
inlinestatic |
Returns the Photo save file size.
|
inlinestatic |
Returns the Photo save file size.
|
inline |
Returns the Photo save file size.
|
inline |
Sets all cross-format Buffer to default size.
|
inlinestatic |
Sets all cross-format Buffer to default size.
|
inline |
Moves all Buffer offsets to correct position.
|
inlinestatic |
Moves all Buffer offsets to correct position.
void RagePhoto::setDescription | ( | const std::string & | description, |
uint32_t | bufferSize = 0 |
||
) |
Sets the Photo description.
void RagePhoto::setFormat | ( | uint32_t | photoFormat | ) |
Sets the Photo Format (GTA V or RDR 2).
void RagePhoto::setFormatLoadFunction | ( | uint32_t | photoFormat, |
RagePhotoLoadFunc | func | ||
) |
Sets a custom Photo Format load function.
void RagePhoto::setHeader | ( | const std::string & | header, |
uint32_t | headerSum | ||
) |
Sets the Photo header. (EXPERT ONLY)
void RagePhoto::setJson | ( | const std::string & | json, |
uint32_t | bufferSize = 0 |
||
) |
Sets the Photo JSON data.
bool RagePhoto::setPhoto | ( | const char * | data, |
uint32_t | size, | ||
uint32_t | bufferSize = 0 |
||
) |
Sets the Photo JPEG data.
data | JPEG data |
size | JPEG data size |
bufferSize | JPEG buffer size |
bool RagePhoto::setPhoto | ( | const std::string & | data, |
uint32_t | bufferSize = 0 |
||
) |
Sets the Photo JPEG data.
data | JPEG data |
bufferSize | JPEG buffer size |
void RagePhoto::setTitle | ( | const std::string & | title, |
uint32_t | bufferSize = 0 |
||
) |
Sets the Photo title.
const std::string & RagePhoto::title | ( | ) | const |
Returns the Photo title.
|
static |
Returns the library version.