Browse Source

new method isScriptfile. operates like isFIle, but also checks variations on extentions

AzaezelX 4 years ago
parent
commit
38b565e12a
2 changed files with 12 additions and 1 deletions
  1. 11 1
      Engine/source/platform/platform.cpp
  2. 1 0
      Engine/source/platform/platform.h

+ 11 - 1
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")));
+}

+ 1 - 0
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);