diff options
author | 2022-09-25 22:08:17 -0400 | |
---|---|---|
committer | 2022-09-25 22:08:17 -0400 | |
commit | 6252b49c4754620e641d18bc4f8e620a570e4e66 (patch) | |
tree | a31a1058965dd3ae132172317fca6b89d57e0b6a /src/lib/util/path.h | |
parent | 7e61dc3a3dacb645de7554eadf7e43ff62b47914 (diff) |
corefile.h: Move filename utilities to path.h
Diffstat (limited to 'src/lib/util/path.h')
-rw-r--r-- | src/lib/util/path.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/util/path.h b/src/lib/util/path.h index 8638bcb332b..204c3503bbf 100644 --- a/src/lib/util/path.h +++ b/src/lib/util/path.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Vas Crabb +// copyright-holders:Vas Crabb, Aaron Giles /*************************************************************************** path.h @@ -13,6 +13,7 @@ #include "osdfile.h" // for PATH_SEPARATOR #include <string> +#include <string_view> #include <utility> @@ -80,4 +81,20 @@ inline std::string path_concat(T &&first, U &&... more) } // namespace util + +/*************************************************************************** + FUNCTION PROTOTYPES +***************************************************************************/ + +/* ----- filename utilities ----- */ + +// extract the base part of a filename (remove extensions and paths) +std::string_view core_filename_extract_base(std::string_view name, bool strip_extension = false) noexcept; + +// extracts the file extension from a filename +std::string_view core_filename_extract_extension(std::string_view filename, bool strip_period = false) noexcept; + +// true if the given filename ends with a particular extension +bool core_filename_ends_with(std::string_view filename, std::string_view extension) noexcept; + #endif // MAME_LIB_UTIL_PATH_H |