2016-12-28 19:45:01 +01:00
|
|
|
/*****************************************************************************
|
2018-06-15 14:07:34 +02:00
|
|
|
* Copyright (c) 2014-2018 OpenRCT2 developers
|
2016-12-28 19:45:01 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-12-28 19:45:01 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-12-28 19:45:01 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2017-07-28 19:35:07 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FILE_EXTENSION_UNKNOWN,
|
|
|
|
FILE_EXTENSION_DAT,
|
|
|
|
FILE_EXTENSION_SC4,
|
|
|
|
FILE_EXTENSION_SV4,
|
|
|
|
FILE_EXTENSION_TD4,
|
|
|
|
FILE_EXTENSION_SC6,
|
|
|
|
FILE_EXTENSION_SV6,
|
|
|
|
FILE_EXTENSION_TD6,
|
|
|
|
};
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2016-12-28 19:45:01 +01:00
|
|
|
interface IStream;
|
|
|
|
|
|
|
|
enum class FILE_TYPE
|
|
|
|
{
|
|
|
|
UNDEFINED,
|
|
|
|
OBJECT,
|
|
|
|
SAVED_GAME,
|
|
|
|
SCENARIO,
|
|
|
|
TRACK_DESIGN,
|
|
|
|
};
|
|
|
|
|
2017-08-23 08:04:36 +02:00
|
|
|
struct ClassifiedFileInfo
|
2016-12-28 19:45:01 +01:00
|
|
|
{
|
2018-05-12 15:13:48 +02:00
|
|
|
FILE_TYPE Type = FILE_TYPE::UNDEFINED;
|
|
|
|
uint32 Version = 0;
|
2016-12-28 19:45:01 +01:00
|
|
|
};
|
|
|
|
|
2017-08-23 08:04:36 +02:00
|
|
|
#define FILE_TYPE_S4_CUTOFF 2
|
|
|
|
bool TryClassifyFile(const std::string &path, ClassifiedFileInfo * result);
|
|
|
|
bool TryClassifyFile(IStream * stream, ClassifiedFileInfo * result);
|
2017-07-28 19:35:07 +02:00
|
|
|
|
2018-02-01 18:49:14 +01:00
|
|
|
uint32 get_file_extension_type(const utf8 * path);
|