From 38b565e12ae2dd89092cbdd6b53e0098bbd2ba44 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 22 Jul 2021 11:56:35 -0500 Subject: [PATCH] new method isScriptfile. operates like isFIle, but also checks variations on extentions --- Engine/source/platform/platform.cpp | 12 +++++++++++- Engine/source/platform/platform.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Engine/source/platform/platform.cpp b/Engine/source/platform/platform.cpp index 28174a922..b75518d1c 100644 --- a/Engine/source/platform/platform.cpp +++ b/Engine/source/platform/platform.cpp @@ -155,4 +155,14 @@ void Platform::setWebDeployment(bool v) gWebDeployment = v; } - +bool Platform::isScriptFile(const char* pFilePath) +{ + return (isFile(pFilePath) + || isFile(pFilePath + String(".dso")) + || isFile(pFilePath + String(".mis")) + || isFile(pFilePath + String(".mis.dso")) + || isFile(pFilePath + String(".gui")) + || isFile(pFilePath + String(".gui.dso")) + || isFile(pFilePath + String("." TORQUE_SCRIPT_EXTENSION)) + || isFile(pFilePath + String("." TORQUE_SCRIPT_EXTENSION) + String(".dso"))); +} diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 7158c5163..cafcae760 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -289,6 +289,7 @@ namespace Platform bool hasSubDirectory( const char *pPath ); bool getFileTimes(const char *filePath, FileTime *createTime, FileTime *modifyTime); bool isFile(const char *pFilePath); + bool isScriptFile(const char* pFilePath); S32 getFileSize(const char *pFilePath); bool isDirectory(const char *pDirPath); bool isSubDirectory(const char *pParent, const char *pDir);