1 /** @file mapmanifests.h
2  *
3  * @authors Copyright © 2013-2015 Daniel Swanson <danij@dengine.net>
4  * @authors Copyright © 2013-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
5  *
6  * @par License
7  * GPL: http://www.gnu.org/licenses/gpl.html
8  *
9  * <small>This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by the
11  * Free Software Foundation; either version 2 of the License, or (at your
12  * option) any later version. This program is distributed in the hope that it
13  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15  * Public License for more details. You should have received a copy of the GNU
16  * General Public License along with this program; if not, see:
17  * http://www.gnu.org/licenses</small>
18  */
19 
20 #ifndef LIBDOOMSDAY_RESOURCE_MAPMANIFESTS_H
21 #define LIBDOOMSDAY_RESOURCE_MAPMANIFESTS_H
22 
23 #include "mapmanifest.h"
24 #include <de/PathTree>
25 
26 namespace res {
27 
28 class LIBDOOMSDAY_PUBLIC MapManifests
29 {
30 public:
31     typedef de::PathTreeT<MapManifest> Tree;
32 
33 public:
34     MapManifests();
35 
36     /**
37      * Locate the map resource manifest associated with the given, unique @a mapUri.
38      *
39      * Note that the existence of a resource manifest does not automatically mean the
40      * associated resource data is actually loadable.
41      */
42     res::MapManifest &findMapManifest(de::Uri const &mapUri) const;
43 
44     /**
45      * Lookup the map resource manifest associated with the given, unique @a mapUri.
46      * Note that the existence of a resource manifest does not automatically mean the
47      * associated resource data is actually loadable.
48      *
49      * @return  MapManifest associated with @a mapUri if found; otherwise @c nullptr.
50      */
51     res::MapManifest *tryFindMapManifest(de::Uri const &mapUri) const;
52 
53     /**
54      * Returns the total number of map resource manifests in the system.
55      */
56     de::dint mapManifestCount() const;
57 
58     /// @todo make private.
59     void initMapManifests();
60 
61     Tree const &allMapManifests() const;
62 
63 private:
64     DENG2_PRIVATE(d)
65 };
66 
67 } // namespace res
68 
69 #endif // LIBDOOMSDAY_RESOURCE_MAPMANIFESTS_H
70