Skip to content

Commit

Permalink
Refactor|Wad|Zip: Removed redundant composeLumpUri() methods of Wad/Zip
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Nov 12, 2012
1 parent efb0ee2 commit 6a907c3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 43 deletions.
3 changes: 1 addition & 2 deletions doomsday/engine/api/uri.h
Expand Up @@ -180,8 +180,7 @@ namespace de
static Uri* fromReader(reader_s& reader);

/**
* Clears the uri, returning it to an empty state.
* @param uri Uri instance.
* Clear the uri returning it to an empty state.
*/
Uri& clear();

Expand Down
13 changes: 0 additions & 13 deletions doomsday/engine/portable/include/wad.h
Expand Up @@ -77,19 +77,6 @@ class Wad : public File1
*/
PathTree::Node& lumpDirectoryNode(int lumpIdx) const;

/**
* Compose an absolute URI to a lump contained by this file.
*
* @note Always returns a valid Uri object. If @a lumpIdx is not valid a
* zero-length Uri is returned.
*
* @param lumpIdx Logical index for the lump.
* @param delimiter Delimit directory separators using this character.
*
* @return The absolute URI.
*/
de::Uri composeLumpUri(int lumpIdx, QChar delimiter = '/');

/**
* Retrieve a lump contained by this file.
*
Expand Down
13 changes: 0 additions & 13 deletions doomsday/engine/portable/include/zip.h
Expand Up @@ -80,19 +80,6 @@ class Zip : public File1
*/
PathTree::Node& lumpDirectoryNode(int lumpIdx) const;

/**
* Compose an absolute URI to a lump contained by this file.
*
* @note Always returns a valid Uri object. If @a lumpIdx is not valid a
* zero-length Uri is returned.
*
* @param lumpIdx Logical index for the lump.
* @param delimiter Delimit directory separators using this character.
*
* @return The absolute URI.
*/
de::Uri composeLumpUri(int lumpIdx, QChar delimiter = '/');

/**
* Retrieve a lump contained by this file.
*
Expand Down
8 changes: 1 addition & 7 deletions doomsday/engine/portable/src/wad.cpp
Expand Up @@ -78,7 +78,7 @@ class WadFile : public File1
*/
Uri composeUri(QChar delimiter = '/') const
{
return dynamic_cast<Wad&>(container()).composeLumpUri(info_.lumpIdx, delimiter);
return directoryNode().composeUri(delimiter);
}

/**
Expand Down Expand Up @@ -407,12 +407,6 @@ PathTree::Node& Wad::lumpDirectoryNode(int lumpIdx) const
return *((*d->lumpNodeLut)[lumpIdx]);
}

de::Uri Wad::composeLumpUri(int lumpIdx, QChar delimiter)
{
if(!isValidIndex(lumpIdx)) return de::Uri();
return lump(lumpIdx).directoryNode().composeUri(delimiter);
}

File1& Wad::lump(int lumpIdx)
{
LOG_AS("Wad");
Expand Down
11 changes: 3 additions & 8 deletions doomsday/engine/portable/src/zip.cpp
Expand Up @@ -161,7 +161,7 @@ class ZipFile : public File1
*/
Uri composeUri(QChar delimiter = '/') const
{
return dynamic_cast<Zip&>(container()).composeLumpUri(info_.lumpIdx, delimiter);
return directoryNode().composeUri(delimiter);
}

/**
Expand Down Expand Up @@ -503,7 +503,8 @@ struct Zip::Instance
}

/**
* @param buffer Must be large enough to hold the entire uncompressed data lump.
* @param lump Lump/file to be buffered.
* @param buffer Must be large enough to hold the entire uncompressed data lump.
*/
size_t bufferLump(ZipFile const& lump, uint8_t* buffer)
{
Expand Down Expand Up @@ -577,12 +578,6 @@ PathTree::Node& Zip::lumpDirectoryNode(int lumpIdx) const
return *((*d->lumpNodeLut)[lumpIdx]);
}

de::Uri Zip::composeLumpUri(int lumpIdx, QChar delimiter)
{
if(!isValidIndex(lumpIdx)) return de::Uri();
return lump(lumpIdx).directoryNode().composeUri(delimiter);
}

File1& Zip::lump(int lumpIdx)
{
LOG_AS("Zip");
Expand Down

0 comments on commit 6a907c3

Please sign in to comment.