Skip to content

Commit

Permalink
FS|libcore: Querying a package's tags as a list
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 23, 2015
1 parent 44327f2 commit d104281
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doomsday/sdk/libcore/include/de/filesys/package.h
Expand Up @@ -153,6 +153,8 @@ class DENG2_PUBLIC Package
*/
static void validateMetadata(Record const &packageInfo);

static QStringList tags(File const &packageFile);

static String identifierForFile(File const &file);

/**
Expand All @@ -165,14 +167,14 @@ class DENG2_PUBLIC Package
static File const *containerOfFile(File const &file);

static String identifierForContainerOfFile(File const &file);

/**
* Finds the package that contains @a file and returns its modification time.
* If the file doesn't appear to be inside a package, returns the file's
* If the file doesn't appear to be inside a package, returns the file's
* modification time.
*
* @param file File.
*
*
* @return Modification time of file or package.
*/
static Time containerOfFileModifiedAt(File const &file);
Expand Down
5 changes: 5 additions & 0 deletions doomsday/sdk/libcore/src/filesys/package.cpp
Expand Up @@ -306,6 +306,11 @@ void Package::validateMetadata(Record const &packageInfo)
}
}

QStringList Package::tags(File const &packageFile)
{
return packageFile.info().gets("package.tags").split(' ', QString::SkipEmptyParts);
}

static String stripAfterFirstUnderscore(String str)
{
int pos = str.indexOf('_');
Expand Down

0 comments on commit d104281

Please sign in to comment.