ScummVM API documentation
nuvie_file_list.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef NUVIE_FILES_NUVIE_FILE_LIST_H
23#define NUVIE_FILES_NUVIE_FILE_LIST_H
24
25#include "common/str.h"
26#include "common/fs.h"
27
28namespace Ultima {
29namespace Nuvie {
30
31
32#define NUVIE_SORT_TIME_DESC 0x1
33#define NUVIE_SORT_TIME_ASC 0x2
34#define NUVIE_SORT_NAME_DESC 0x3
35#define NUVIE_SORT_NAME_ASC 0x5
36
37class Configuration;
38
40public:
41 Common::String filename;
42 uint32 m_time;
43
44 bool operator<(const NuvieFileDesc &rhs) const {
45 return (rhs.m_time < this->m_time);
46 };
47 bool operator()(const NuvieFileDesc &lhs, const NuvieFileDesc &rhs) {
48 return (lhs.m_time > rhs.m_time);
49 };
50};
51
53protected:
55
56 uint8 sort_mode;
57protected:
58 bool add_filename(const Common::String &fileName);
59public:
60
63
64 bool open(const Common::Path &directory, const char *restrict, uint8 sort_mode);
65
66 Common::String *next();
67 const Common::String *get_latest() const;
68 uint32 get_num_files() const;
69
70 const Common::List<NuvieFileDesc> &get_filelist() const;
71
72 void close();
73};
74
75
76} // End of namespace Nuvie
77} // End of namespace Ultima
78
79#endif
Definition: list.h:44
Definition: path.h:52
Definition: str.h:59
Definition: nuvie_file_list.h:39
Definition: nuvie_file_list.h:52