Skip to content

Commit

Permalink
FS|Network: Querying package category tags
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 12, 2017
1 parent b3d3194 commit 0bfbbb3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Expand Up @@ -31,6 +31,8 @@ class IdgamesLink : public de::filesys::WebHostedLink

void parseRepositoryIndex(QByteArray data) override;

de::StringList categoryTags() const override;

de::LoopResult forPackageIds(std::function<de::LoopResult (de::String const &packageId)> func) const override;

de::String findPackagePath(de::String const &packageId) const override;
Expand Down
8 changes: 8 additions & 0 deletions doomsday/apps/libdoomsday/src/filesys/idgameslink.cpp
Expand Up @@ -233,6 +233,14 @@ void IdgamesLink::parseRepositoryIndex(QByteArray data)
});
}

StringList IdgamesLink::categoryTags() const
{
return StringList({ CATEGORY_LEVELS,
CATEGORY_MUSIC,
CATEGORY_SOUNDS,
CATEGORY_THEMES });
}

LoopResult IdgamesLink::forPackageIds(std::function<LoopResult (String const &)> func) const
{
PathTreeIterator<Impl::PackageIndexEntry> iter(d->packageIndex.leafNodes());
Expand Down
8 changes: 8 additions & 0 deletions doomsday/sdk/libcore/include/de/filesys/remote/link.h
Expand Up @@ -71,6 +71,14 @@ class DENG2_PUBLIC Link
*/
virtual PackagePaths locatePackages(StringList const &packageIds) const = 0;

/**
* Returns a list of the categories in the repository. These can be used as tags
* for filtering.
*
* @return Category tags.
*/
virtual StringList categoryTags() const;

/**
* Iterates the full list of all packages available in the repository. Note this
* may be large set of packages.
Expand Down
5 changes: 5 additions & 0 deletions doomsday/sdk/libcore/src/filesys/remote/link.cpp
Expand Up @@ -157,6 +157,11 @@ Link::State Link::state() const
return d->state;
}

StringList Link::categoryTags() const
{
return StringList();
}

void Link::wasConnected()
{
DENG2_ASSERT_IN_MAIN_THREAD();
Expand Down

0 comments on commit 0bfbbb3

Please sign in to comment.