Skip to content

Commit

Permalink
Cleanup|libdoomsday: Dumped the obsolete F_PrependBasePath()
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jun 17, 2014
1 parent 8d91617 commit 376dd91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
14 changes: 1 addition & 13 deletions doomsday/libdoomsday/include/doomsday/filesys/fs_util.h
Expand Up @@ -64,18 +64,6 @@ LIBDOOMSDAY_PUBLIC dd_bool F_ToNativeSlashes(ddstring_t *dst, ddstring_t const *
*/
LIBDOOMSDAY_PUBLIC dd_bool F_IsAbsolute(ddstring_t const *path);

/**
* Attempt to prepend the base path. If @a src is already absolute do nothing.
*
* @param dst Absolute path written here.
* @param src Original path.
* @param base Base to attempt to prepend to @a src.
*
* @return @c true iff the path was prepended.
*/
LIBDOOMSDAY_PUBLIC dd_bool F_PrependBasePath2(ddstring_t *dst, ddstring_t const *src, ddstring_t const *base);
LIBDOOMSDAY_PUBLIC dd_bool F_PrependBasePath(ddstring_t *dst, ddstring_t const *src /*, ddstring_t const *base = ddBasePath*/);

/**
* Expands relative path directives like '>'.
*
Expand All @@ -102,7 +90,7 @@ LIBDOOMSDAY_PUBLIC dd_bool F_ExpandBasePath(ddstring_t *dst, ddstring_t const *s
*
* @return @c true iff successful.
*/
LIBDOOMSDAY_PUBLIC dd_bool F_DumpFile(de::File1 &file, char const *fileName);
LIBDOOMSDAY_PUBLIC dd_bool F_DumpFile(de::File1 &file, char const *outputPath);

/**
* Write data into a file.
Expand Down
28 changes: 1 addition & 27 deletions doomsday/libdoomsday/src/filesys/fs_util.cpp
Expand Up @@ -301,32 +301,6 @@ dd_bool F_IsAbsolute(const ddstring_t* str)
return false;
}

dd_bool F_PrependBasePath2(ddstring_t* dst, const ddstring_t* src, const ddstring_t* base)
{
assert(dst && src && base);

if(!F_IsAbsolute(src))
{
if(dst != src)
Str_Set(dst, Str_Text(src));
Str_Prepend(dst, Str_Text(base));
return true;
}

// Do we need to copy anyway?
if(dst != src)
Str_Set(dst, Str_Text(src));

return false; // Not done.
}

dd_bool F_PrependBasePath(ddstring_t* dst, const ddstring_t* src)
{
ddstring_t base;
Str_InitStatic(&base, DD_BasePath());
return F_PrependBasePath2(dst, src, &base);
}

dd_bool F_ExpandBasePath(ddstring_t* dst, const ddstring_t* src)
{
assert(dst && src);
Expand Down Expand Up @@ -486,7 +460,7 @@ dd_bool F_Dump(void const *data, size_t size, char const *path)

if(!size) return false;

AutoStr* nativePath = AutoStr_NewStd();
AutoStr *nativePath = AutoStr_NewStd();
Str_Set(nativePath, path);
F_ToNativeSlashes(nativePath, nativePath);

Expand Down

0 comments on commit 376dd91

Please sign in to comment.