Debian Codegraph @

src/engine/dir.h

raw symbols SCIP
1 /***************************************************************************
2 * fheroes2: https://github.com/ihhub/fheroes2 *
3 * Copyright (C) 2019 - 2025 *
4 * *
5 * Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 *
6 * Copyright (C) 2009 by Andrey Afletdinov <[email protected]> *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22 ***************************************************************************/
23
24 #pragma once
25
26 #include <list>
27 #include <string>
28 #include <string_view>
29
30 struct ListFiles : public std::list<std::string>
31 {
32 void Append( ListFiles && files );
33
34 // Adds files from the 'path' directory ending in 'filter' to the list, case-insensitive.
35 void ReadDir( const std::string & path, const std::string & filter );
36
37 // Adds the first found file from the 'path' directory with a name matching 'fileName' to the list, case-insensitive.
38 void FindFileInDir( const std::string_view path, const std::string_view fileName );
39
40 // Returns true if there are no files in the 'path' directory with names ending in 'filter', case-insensitive, otherwise returns false.
41 static bool IsEmpty( const std::string & path, const std::string & filter );
42 };