RagePhoto: add RagePhotoPrivate class

This commit is contained in:
Syping 2021-11-28 06:25:31 +01:00
parent 81675355b0
commit 6bb8843971
6 changed files with 289 additions and 256 deletions

View File

@ -2,9 +2,9 @@ name: Ubuntu
on:
push:
branches: [ master ]
branches: [ test ]
pull_request:
branches: [ master ]
branches: [ test ]
env:
BUILD_TYPE: Release

View File

@ -2,9 +2,9 @@ name: Windows
on:
push:
branches: [ master ]
branches: [ test ]
pull_request:
branches: [ master ]
branches: [ test ]
env:
BUILD_TYPE: Release

File diff suppressed because it is too large Load Diff

View File

@ -22,14 +22,12 @@
#ifdef __cplusplus
#include "libragephoto_global.h"
#include "RagePhotoData.h"
#include <unordered_map>
#include <functional>
#include <iostream>
#include <cstdlib>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <iostream>
typedef std::function<bool(const char*, size_t, RagePhotoData*)> RagePhotoLoadFunc;
class RagePhotoPrivate;
/**
* \brief GTA V and RDR 2 Photo Parser.
@ -168,8 +166,7 @@ public:
void setTitle(const std::string &title, uint32_t bufferSize = 0); /**< Sets the Photo title. */
private:
std::unordered_map<uint8_t, RagePhotoLoadFunc> m_loadFuncs;
RagePhotoData m_data;
RagePhotoPrivate *m_rpp;
};
#else
#include "RagePhotoC.h"

View File

@ -21,8 +21,9 @@
#ifdef __cplusplus
#include "libragephoto_global.h"
#include <iostream>
#include <cstdint>
#include <iostream>
#include <functional>
struct LIBRAGEPHOTO_CXX_EXPORT RagePhotoData
{
@ -47,6 +48,8 @@ struct LIBRAGEPHOTO_CXX_EXPORT RagePhotoData
uint32_t unnamedSum1;
uint32_t unnamedSum2;
};
typedef std::function<bool(const char*, size_t, RagePhotoData*)> RagePhotoLoadFunc;
#endif // __cplusplus
#endif // RAGEPHOTODATA_H

31
src/RagePhoto_p.h Normal file
View File

@ -0,0 +1,31 @@
/*****************************************************************************
* libragephoto RAGE Photo Parser
* Copyright (C) 2021 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* This software is provided as-is, no warranties are given to you, we are not
* responsible for anything with use of the software, you are self responsible.
*****************************************************************************/
#ifndef RAGEPHOTO_P_H
#define RAGEPHOTO_P_H
#include "RagePhotoData.h"
#include <iostream>
#include <unordered_map>
class RagePhotoPrivate {
public:
std::unordered_map<uint8_t, RagePhotoLoadFunc> m_loadFuncs;
RagePhotoData m_data;
};
#endif // RAGEPHOTO_P_H