From 47f09ad8fb52de7ee9ed6c63574ea2f77e314fa2 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sat, 23 Oct 2021 02:24:24 +0200 Subject: Sort filenames alpha-numeric, used as template system dependency management. Signed-off-by: Toni Uhlig --- src/Filesystem.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Filesystem.cpp') diff --git a/src/Filesystem.cpp b/src/Filesystem.cpp index 9fe13bb..f3824e3 100644 --- a/src/Filesystem.cpp +++ b/src/Filesystem.cpp @@ -135,6 +135,21 @@ FilesDict & Filesystem::GetFiles() return m_Files; } +void Filesystem::GetFilenamesSorted(std::vector & sortedFilenames) +{ + for (auto const & f : GetFiles()) + { + sortedFilenames.push_back(f.first); + } + std::sort(sortedFilenames.begin(), sortedFilenames.end()); +#if 1 + for (auto const & f : sortedFilenames) + { + std::cout << "Added file (alnum sorted): " << f << std::endl; + } +#endif +} + void Filesystem::MagicInit() { m_Magic = magic_open(MAGIC_MIME_TYPE); -- cgit v1.2.3