Skip to content

Commit

Permalink
add CFileUtils::DeleteItem(const CStdString &strPath, bool force)
Browse files Browse the repository at this point in the history
  • Loading branch information
amet committed May 26, 2012
1 parent 430f177 commit 0fe9189
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xbmc/utils/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
using namespace XFILE;
using namespace std;

bool CFileUtils::DeleteItem(const CStdString &strPath, bool force)
{
CFileItemPtr item(new CFileItem(strPath));
item->SetPath(strPath);
item->m_bIsFolder = URIUtils::HasSlashAtEnd(strPath);
item->Select(true);
return DeleteItem(item, force);
}

bool CFileUtils::DeleteItem(const CFileItemPtr &item, bool force)
{
if (!item || item->IsParentFolder())
Expand Down
1 change: 1 addition & 0 deletions xbmc/utils/FileUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class CFileUtils
{
public:
static bool DeleteItem(const CFileItemPtr &item, bool force=false);
static bool DeleteItem(const CStdString &strPath, bool force=false);
static bool RenameFile(const CStdString &strFile);
static bool SubtitleFileSizeAndHash(const CStdString &path, CStdString &strSize, CStdString &strHash);
};

0 comments on commit 0fe9189

Please sign in to comment.