Skip to content

Commit

Permalink
Refactor|FileSys: Minor cleanup refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Oct 12, 2012
1 parent 8ade630 commit e2ba497
Show file tree
Hide file tree
Showing 7 changed files with 350 additions and 344 deletions.
26 changes: 20 additions & 6 deletions doomsday/engine/portable/include/abstractfile.h
Expand Up @@ -65,6 +65,21 @@ class PathDirectoryNode;
*/
class AbstractFile
{
public:
/// Categorization flags.
enum Flag
{
/// Flagged as having been loaded during the game startup process.
Startup = 0x1,

/// Flagged as a non-original game resource.
Custom = 0x2,

/// All resources are by default flagged as "custom".
DefaultFlags = Custom
};
Q_DECLARE_FLAGS(Flags, Flag)

private:
AbstractFile();

Expand Down Expand Up @@ -134,7 +149,7 @@ class AbstractFile
/// Mark this resource as "custom".
AbstractFile& setCustom(bool yes);

DFile* handle();
DFile& handle();

/**
* Access interfaces:
Expand Down Expand Up @@ -310,11 +325,8 @@ class AbstractFile
/// @see filetype_t
filetype_t type_;

struct abstractfile_flags_s
{
uint startup:1; ///< Loaded during the startup process.
uint custom:1; /// < Not an original game resource.
} flags;
/// Categorization flags.
Flags flags;

/// Absolute variable-length path in the vfs.
ddstring_t path_;
Expand All @@ -326,6 +338,8 @@ class AbstractFile
uint order;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractFile::Flags)

} // namespace de

extern "C" {
Expand Down
5 changes: 0 additions & 5 deletions doomsday/engine/portable/include/dfilebuilder.h
Expand Up @@ -81,11 +81,6 @@ extern "C" {
/// @return File object represented by this handle.
struct abstractfile_s* DFile_File(DFile* hndl);

/// @return FileList object which owns this handle.
struct filelist_s* DFile_List(DFile* hndl);

DFile* DFile_SetList(DFile* hndl, struct filelist_s* list);

/// @return File object represented by this handle.
struct abstractfile_s* DFile_File_const(DFile const* hndl);

Expand Down

0 comments on commit e2ba497

Please sign in to comment.