#include <sbMediaFileManager.h>
|
virtual | ~sbMediaFileManager () |
| Destructor of the sbMediaFileManager component. More...
|
|
nsresult | GetNewPath (sbIMediaItem *aMediaItem, nsString &aPath, PRBool *aRetVal) |
| Construct the new path based on user settings. More...
|
|
nsresult | GetNewFilename (sbIMediaItem *aMediaItem, nsIURI *aItemUri, nsString &aFilename, PRBool *aRetVal) |
| Construct the new filename based on user settings. More...
|
|
nsresult | CopyRename (sbIMediaItem *aMediaItem, nsIFile *aItemFile, nsIFile *aNewFile, PRBool *aRetVal) |
| Copys a file from the old location to the new location, ensures that the destination is in the managed folder and that unique filenames are used if the destination file already exists. More...
|
|
nsresult | Delete (nsIFile *aItemFile, PRBool *aRetVal) |
| Deletes a file associated with an item if it is located in the managed folder. More...
|
|
nsresult | CheckDirectoryForDeletion (nsIFile *aItemFile) |
| Checks whether a directory and its parent directories need to be deleted. More...
|
|
nsresult | NormalizeDir (nsString &aDir) |
| Makes sure that a directory ends with the path separator if it can. More...
|
|
nsresult | ZeroPadTrackNumber (const nsAString &aTrackNumStr, const nsAString &aTotalTrackCountStr, nsString &aOutString) |
| Format a track number to pad for zeros against the total track count. More...
|
|
Definition at line 64 of file sbMediaFileManager.h.
sbMediaFileManager::sbMediaFileManager |
( |
| ) |
|
sbMediaFileManager::~sbMediaFileManager |
( |
| ) |
|
|
protectedvirtual |
nsresult sbMediaFileManager::CheckDirectoryForDeletion |
( |
nsIFile * |
aItemFile | ) |
|
|
protected |
Checks whether a directory and its parent directories need to be deleted.
- Parameters
-
aItemFile | - The file we check the directories for. |
Definition at line 1426 of file sbMediaFileManager.cpp.
nsresult sbMediaFileManager::CopyRename |
( |
sbIMediaItem * |
aMediaItem, |
|
|
nsIFile * |
aSrcFile, |
|
|
nsIFile * |
aDestFile, |
|
|
PRBool * |
aRetVal |
|
) |
| |
|
protected |
Copys a file from the old location to the new location, ensures that the destination is in the managed folder and that unique filenames are used if the destination file already exists.
- Parameters
-
aMediaItem | - The media item we are organizing. |
aSrcFile | - Original file for item. |
aDestFile | - New file for item. |
aRetVal | - True if successful. |
Definition at line 1285 of file sbMediaFileManager.cpp.
nsresult sbMediaFileManager::Delete |
( |
nsIFile * |
aItemFile, |
|
|
PRBool * |
aRetVal |
|
) |
| |
|
protected |
Deletes a file associated with an item if it is located in the managed folder.
- Parameters
-
aItemFile | - Items file to delete. |
aRetVal | - True if successful. |
Definition at line 1501 of file sbMediaFileManager.cpp.
nsresult sbMediaFileManager::GetNewFilename |
( |
sbIMediaItem * |
aMediaItem, |
|
|
nsIURI * |
aItemUri, |
|
|
nsString & |
aFilename, |
|
|
PRBool * |
aRetVal |
|
) |
| |
|
protected |
Construct the new filename based on user settings.
- Parameters
-
aMediaItem | - The media item we are organizing. |
aItemUri | - Original file path |
aFilename | - Newly generated filename from the items metadata. This function will replace aFilename with new contents. |
aRetVal | - True if successful. |
Definition at line 854 of file sbMediaFileManager.cpp.
nsresult sbMediaFileManager::GetNewPath |
( |
sbIMediaItem * |
aMediaItem, |
|
|
nsString & |
aPath, |
|
|
PRBool * |
aRetVal |
|
) |
| |
|
protected |
Construct the new path based on user settings.
- Parameters
-
aMediaItem | - The media item we are organizing. |
aPath | - Newly generated path from the items metadata. |
aRetVal | - True if successful. |
Definition at line 928 of file sbMediaFileManager.cpp.
NS_IMETHODIMP sbMediaFileManager::Init |
( |
| ) |
|
nsresult sbMediaFileManager::NormalizeDir |
( |
nsString & |
aDir | ) |
|
|
protected |
Makes sure that a directory ends with the path separator if it can.
- Parameters
-
aDir | - The string version of the directory to ensure has a trailing directory separator. |
Definition at line 1223 of file sbMediaFileManager.cpp.
nsresult sbMediaFileManager::ZeroPadTrackNumber |
( |
const nsAString & |
aTrackNumStr, |
|
|
const nsAString & |
aTotalTrackCountStr, |
|
|
nsString & |
aOutString |
|
) |
| |
|
protected |
Format a track number to pad for zeros against the total track count.
- Parameters
-
aTrackNumStr | The track number property as a string. |
aTotalTrackCountStr | The total tracks property as a string |
aOutString | The out-param for the formatted string. |
Example: 2 of 10 tracks will return "02" 2 of 100 tracks will return "002"
Definition at line 1246 of file sbMediaFileManager.cpp.
The documentation for this class was generated from the following files: