|
@@ -97,20 +97,15 @@ public:
|
|
|
// -------------------------------------------------------------------
|
|
|
/** Returns whether the class can handle the format of the given file.
|
|
|
*
|
|
|
- * The implementation should be as quick as possible. A check for
|
|
|
- * the file extension is enough. If no suitable loader is found with
|
|
|
- * this strategy, CanRead() is called again, the 'checkSig' parameter
|
|
|
- * set to true this time. Now the implementation is expected to
|
|
|
- * perform a full check of the file structure, possibly searching the
|
|
|
- * first bytes of the file for magic identifiers or keywords.
|
|
|
+ * The implementation is expected to perform a full check of the file
|
|
|
+ * structure, possibly searching the first bytes of the file for magic
|
|
|
+ * identifiers or keywords.
|
|
|
*
|
|
|
* @param pFile Path and file name of the file to be examined.
|
|
|
* @param pIOHandler The IO handler to use for accessing any file.
|
|
|
- * @param checkSig Set to true if this method is called a second time.
|
|
|
- * This time, the implementation may take more time to examine the
|
|
|
- * contents of the file to be loaded for magic bytes, keywords, etc
|
|
|
- * to be able to load files with unknown/not existent file extensions.
|
|
|
- * @return true if the class can read this file, false if not.
|
|
|
+ * @param checkSig Legacy; do not use.
|
|
|
+ * @return true if the class can read this file, false if not or if
|
|
|
+ * unsure.
|
|
|
*/
|
|
|
virtual bool CanRead(
|
|
|
const std::string &pFile,
|
|
@@ -295,25 +290,11 @@ public: // static utilities
|
|
|
IOSystem *pIOSystem,
|
|
|
const std::string &file,
|
|
|
const char **tokens,
|
|
|
- unsigned int numTokens,
|
|
|
+ std::size_t numTokens,
|
|
|
unsigned int searchBytes = 200,
|
|
|
bool tokensSol = false,
|
|
|
bool noAlphaBeforeTokens = false);
|
|
|
|
|
|
- // -------------------------------------------------------------------
|
|
|
- /** @brief Check whether a file has a specific file extension
|
|
|
- * @param pFile Input file
|
|
|
- * @param ext0 Extension to check for. Lowercase characters only, no dot!
|
|
|
- * @param ext1 Optional second extension
|
|
|
- * @param ext2 Optional third extension
|
|
|
- * @note Case-insensitive
|
|
|
- */
|
|
|
- static bool SimpleExtensionCheck(
|
|
|
- const std::string &pFile,
|
|
|
- const char *ext0,
|
|
|
- const char *ext1 = nullptr,
|
|
|
- const char *ext2 = nullptr);
|
|
|
-
|
|
|
// -------------------------------------------------------------------
|
|
|
/** @brief Extract file extension from a string
|
|
|
* @param pFile Input file
|
|
@@ -340,7 +321,7 @@ public: // static utilities
|
|
|
IOSystem *pIOHandler,
|
|
|
const std::string &pFile,
|
|
|
const void *magic,
|
|
|
- unsigned int num,
|
|
|
+ std::size_t num,
|
|
|
unsigned int offset = 0,
|
|
|
unsigned int size = 4);
|
|
|
|