Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resources|libdoomsday: Multiple package folders via Config
Improved management of data bundle links, with the capability to recreate and re-identify all the bundles. A new audience was added for observing the completion of the bundle identifying operation.
- Loading branch information
Showing
8 changed files
with
199 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
doomsday/apps/libdoomsday/include/doomsday/resource/bundlelinkfeed.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** @file bundlelinkfeed.h FS feed for managing data bundle links. | ||
* | ||
* @authors Copyright (c) 2016 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef LIBDOOMSDAY_BUNDLELINKFEED_H | ||
#define LIBDOOMSDAY_BUNDLELINKFEED_H | ||
|
||
#include <de/Feed> | ||
|
||
namespace res { | ||
|
||
/** | ||
* FS feed for maanging data bundle links. | ||
* | ||
* The main responsibility of the feed is to prune broken links. | ||
*/ | ||
class BundleLinkFeed : public de::Feed | ||
{ | ||
public: | ||
BundleLinkFeed(); | ||
|
||
de::String description() const override; | ||
void populate(de::Folder &folder) override; | ||
bool prune(de::File &file) const override; | ||
}; | ||
|
||
} // namespace res | ||
|
||
#endif // LIBDOOMSDAY_BUNDLELINKFEED_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @file bundlelinkfeed.cpp | ||
* | ||
* @authors Copyright (c) 2016 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#include "doomsday/resource/bundlelinkfeed.h" | ||
|
||
#include <de/LinkFile> | ||
|
||
using namespace de; | ||
|
||
namespace res { | ||
|
||
BundleLinkFeed::BundleLinkFeed() | ||
{} | ||
|
||
String BundleLinkFeed::description() const | ||
{ | ||
return "data bundle links"; | ||
} | ||
|
||
void BundleLinkFeed::populate(Folder &) | ||
{ | ||
// Links are populated by DataBundle when files are identified. | ||
} | ||
|
||
bool BundleLinkFeed::prune(File &file) const | ||
{ | ||
if (LinkFile const *link = file.maybeAs<LinkFile>()) | ||
{ | ||
// Broken links must be removed. | ||
return link->isBroken(); | ||
} | ||
return false; | ||
} | ||
|
||
} // namespace res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.