rename files
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ExeAppendedZipLoader.hpp"
|
#include "ExeAppendedZipResourceLoader.hpp"
|
||||||
#include "Base/Logger.hpp"
|
#include "Base/Logger.hpp"
|
||||||
#include "IO/Archive/ArchiveReader.hpp"
|
#include "IO/Archive/ArchiveReader.hpp"
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
std::string ExeAppendedZipLoader::GetResourcePath(const std::string& resourceName)
|
std::string ExeAppendedZipResourceLoader::GetResourcePath(const std::string& resourceName)
|
||||||
{
|
{
|
||||||
return GetCurrentExecutablePath();
|
return GetCurrentExecutablePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array<char> ExeAppendedZipLoader::GetResource(const std::string& exeName)
|
Array<char> ExeAppendedZipResourceLoader::GetResource(const std::string& exeName)
|
||||||
{
|
{
|
||||||
std::string ext = std::filesystem::path(exeName).extension().string();
|
std::string ext = std::filesystem::path(exeName).extension().string();
|
||||||
if (ext != ".exe" && ext != "")
|
if (ext != ".exe" && ext != "")
|
||||||
@@ -41,7 +41,7 @@ namespace OpenVulkano
|
|||||||
return zipData;
|
return zipData;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<FileDescription, Array<char>>> ExeAppendedZipLoader::GetZipArchiveFiles(const std::string& exePath)
|
std::vector<std::pair<FileDescription, Array<char>>> ExeAppendedZipResourceLoader::GetZipArchiveFiles(const std::string& exePath)
|
||||||
{
|
{
|
||||||
Array<char> zipData = GetResource(exePath);
|
Array<char> zipData = GetResource(exePath);
|
||||||
ArchiveReader reader(zipData.Data(), zipData.Size(), nullptr, ArchiveType::ZIP);
|
ArchiveReader reader(zipData.Data(), zipData.Size(), nullptr, ArchiveType::ZIP);
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
class ExeAppendedZipLoader : public ResourceLoader
|
class ExeAppendedZipResourceLoader : public ResourceLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string GetResourcePath(const std::string& resourceName) override;
|
std::string GetResourcePath(const std::string& resourceName) override;
|
||||||
@@ -4,17 +4,17 @@
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ExeAppendedZipLoaderWindows.hpp"
|
#include "ExeAppendedZipResourceLoaderWindows.hpp"
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
void* HANDLE = ResourceLoader::RegisterResourceLoader(std::make_unique<ExeAppendedZipLoaderWindows>());
|
void* HANDLE = ResourceLoader::RegisterResourceLoader(std::make_unique<ExeAppendedZipResourceLoaderWindows>());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OpenVulkano::ExeAppendedZipLoaderWindows::GetCurrentExecutablePath() const
|
std::string OpenVulkano::ExeAppendedZipResourceLoaderWindows::GetCurrentExecutablePath() const
|
||||||
{
|
{
|
||||||
CHAR nameBuf[MAX_PATH] = {};
|
CHAR nameBuf[MAX_PATH] = {};
|
||||||
DWORD len = GetModuleFileNameA(NULL, nameBuf, MAX_PATH);
|
DWORD len = GetModuleFileNameA(NULL, nameBuf, MAX_PATH);
|
||||||
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Host/ExeAppendedZipLoader.hpp"
|
#include "Host/ExeAppendedZipResourceLoader.hpp"
|
||||||
|
|
||||||
namespace OpenVulkano
|
namespace OpenVulkano
|
||||||
{
|
{
|
||||||
class ExeAppendedZipLoaderWindows final : public ExeAppendedZipLoader
|
class ExeAppendedZipResourceLoaderWindows final : public ExeAppendedZipResourceLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string GetCurrentExecutablePath() const override;
|
std::string GetCurrentExecutablePath() const override;
|
||||||
Reference in New Issue
Block a user