From 6252b49c4754620e641d18bc4f8e620a570e4e66 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 25 Sep 2022 22:08:17 -0400 Subject: corefile.h: Move filename utilities to path.h --- src/lib/util/path.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/lib/util/path.h') 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 +#include #include @@ -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 -- cgit v1.2.3-70-g09d2