From 1b02ddcbf65921f53425d271463cde46d30d0ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Wed, 11 Jan 2017 23:15:10 +0200 Subject: [PATCH] libdoomsday|Resources: Querying the data bundle format as a text string --- .../apps/libdoomsday/include/doomsday/resource/databundle.h | 1 + doomsday/apps/libdoomsday/src/resource/databundle.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doomsday/apps/libdoomsday/include/doomsday/resource/databundle.h b/doomsday/apps/libdoomsday/include/doomsday/resource/databundle.h index ef6acfdebd..9b434ea274 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/resource/databundle.h +++ b/doomsday/apps/libdoomsday/include/doomsday/resource/databundle.h @@ -60,6 +60,7 @@ class LIBDOOMSDAY_PUBLIC DataBundle : public de::IByteArray ~DataBundle(); Format format() const; + de::String formatAsText() const; de::String description() const; de::File &asFile(); de::File const &asFile() const; diff --git a/doomsday/apps/libdoomsday/src/resource/databundle.cpp b/doomsday/apps/libdoomsday/src/resource/databundle.cpp index 72b12ea82d..8e69b69b03 100644 --- a/doomsday/apps/libdoomsday/src/resource/databundle.cpp +++ b/doomsday/apps/libdoomsday/src/resource/databundle.cpp @@ -719,6 +719,11 @@ DataBundle::Format DataBundle::format() const return d->format; } +String DataBundle::formatAsText() const +{ + return ::internal::formatDescriptions[d->format]; +} + String DataBundle::description() const { if (!d->source)