From 600b62877b0f09aadab1ce08df0643ac37ed4482 Mon Sep 17 00:00:00 2001 From: BearOso Date: Sat, 7 May 2022 19:32:29 -0500 Subject: [PATCH] Add fscompat.h --- fscompat.cpp | 6 ++++++ fscompat.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 fscompat.h diff --git a/fscompat.cpp b/fscompat.cpp index 542c88ce..13c22cda 100644 --- a/fscompat.cpp +++ b/fscompat.cpp @@ -1,3 +1,9 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + #include #include diff --git a/fscompat.h b/fscompat.h new file mode 100644 index 00000000..8c4654cf --- /dev/null +++ b/fscompat.h @@ -0,0 +1,50 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +#pragma once + +#include + +enum s9x_getdirtype +{ + DEFAULT_DIR = 0, + HOME_DIR, + ROMFILENAME_DIR, + ROM_DIR, + SRAM_DIR, + SNAPSHOT_DIR, + SCREENSHOT_DIR, + SPC_DIR, + CHEAT_DIR, + PATCH_DIR, + BIOS_DIR, + LOG_DIR, + SAT_DIR, + LAST_DIR +}; + +struct SplitPath +{ + bool ext_is(const std::string &ext); + std::string drive; + std::string dir; + std::string stem; + std::string ext; +}; + +SplitPath splitpath(std::string filename); +std::string makepath(const std::string &drive, + const std::string &directory, + const std::string &stem, + const std::string &extension); +std::string makepath(const SplitPath &); + +std::string S9xBasename (std::string); +std::string S9xBasenameNoExt (std::string); +std::string S9xGetFilename (std::string ext, enum s9x_getdirtype dirtype); +std::string S9xGetFilename (std::string filename, std::string ext, enum s9x_getdirtype dirtype); +std::string S9xGetDirectory (enum s9x_getdirtype); +std::string S9xGetFilenameInc (std::string, enum s9x_getdirtype);