sbFileUtils.cpp File Reference
#include "sbFileUtils.h"
#include <nsIFileStreams.h>
#include <nsIFileURL.h>
#include <nsILocalFile.h>
#include <nsIURI.h>
#include <nsCOMPtr.h>
#include <nsComponentManagerUtils.h>
#include <nsMemory.h>
#include <nsNetCID.h>
#include <nsNetUtil.h>
#include <sbMemoryUtils.h>
#include <sbProxiedComponentManager.h>
#include <sbURIUtils.h>
Include dependency graph for sbFileUtils.cpp:

Go to the source code of this file.

Functions

nsresult sbOpenInputStream (nsAString const &aPath, nsIInputStream **aStream)
 
nsresult sbOpenInputStream (nsIURI *aURI, nsIInputStream **aStream)
 
nsresult sbOpenInputStream (nsIFile *aFile, nsIInputStream **aStream)
 
nsresult sbOpenOutputStream (nsIFile *aFile, nsIOutputStream **aStream)
 
nsresult sbOpenOutputStream (nsAString const &aPath, nsIOutputStream **aStream)
 
nsresult sbReadFile (nsIFile *aFile, nsACString &aBuffer)
 
nsresult sbConsumeStream (nsIInputStream *stream, PRUint32 maxCount, nsACString &result)
 
nsCOMPtr< nsIIOService > GetIOService (nsresult &rv)
 
nsresult sbNewFileURI (nsIFile *aFile, nsIURI **aURI)
 
void RemoveBadFileNameCharacters (nsAString &aFileName, PRBool aAllPlatforms)
 

Function Documentation

nsCOMPtr<nsIIOService> GetIOService ( nsresult &  rv)
inline

Definition at line 206 of file sbFileUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RemoveBadFileNameCharacters ( nsAString &  aFileName,
PRBool  aAllPlatforms 
)

Remove all bad file name characters from the file name specified by aFileName. If aAllPlatforms is true, remove characters that are bad on any platform; otherwise, only remove characters that are bad on the current platform.

Parameters
aFileNameFile name from which to remove bad characters.
aAllPlatformsIf true, remove characters that are bad on any platform.

Definition at line 275 of file sbFileUtils.cpp.

nsresult sbConsumeStream ( nsIInputStream *  aSource,
PRUint32  aMaxCount,
nsACString &  aBuffer 
)

From xpcom/io/nsStreamUtils.h

Definition at line 166 of file sbFileUtils.cpp.

Here is the caller graph for this function:

nsresult sbNewFileURI ( nsIFile *  aFile,
nsIURI **  aURI 
)

Return in aURI a URI object for the file specified by aFile. Avoids Songbird bug 6227 in nsIIOService.newFileURI.

Parameters
aFileFile for which to get URI.
aURIReturned file URI.

Definition at line 216 of file sbFileUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbOpenInputStream ( nsAString const &  aPath,
nsIInputStream **  aStream 
)

Helper functions to open a stream given a file path

Definition at line 47 of file sbFileUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbOpenInputStream ( nsIURI *  aURI,
nsIInputStream **  aStream 
)

Helper function to open a stream given a file URL

Definition at line 64 of file sbFileUtils.cpp.

Here is the call graph for this function:

nsresult sbOpenInputStream ( nsIFile *  aFile,
nsIInputStream **  aStream 
)

Helper function to open a stream given a file

Definition at line 83 of file sbFileUtils.cpp.

nsresult sbOpenOutputStream ( nsIFile *  aFile,
nsIOutputStream **  aStream 
)

Helper function to open an output stream given a file

Definition at line 104 of file sbFileUtils.cpp.

Here is the caller graph for this function:

nsresult sbOpenOutputStream ( nsAString const &  aPath,
nsIOutputStream **  aStream 
)

Helper function to open an output stream given a file path

Definition at line 125 of file sbFileUtils.cpp.

Here is the call graph for this function:

nsresult sbReadFile ( nsIFile *  aFile,
nsACString &  aBuffer 
)

Read a file into a buffer

Definition at line 143 of file sbFileUtils.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: