#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>
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) |
|
inline |
Definition at line 206 of file sbFileUtils.cpp.
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.
aFileName | File name from which to remove bad characters. |
aAllPlatforms | If 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.
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.
aFile | File for which to get URI. |
aURI | Returned file URI. |
Definition at line 216 of file sbFileUtils.cpp.
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.
nsresult sbOpenInputStream | ( | nsIURI * | aURI, |
nsIInputStream ** | aStream | ||
) |
Helper function to open a stream given a file URL
Definition at line 64 of file sbFileUtils.cpp.
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.
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.
nsresult sbReadFile | ( | nsIFile * | aFile, |
nsACString & | aBuffer | ||
) |
Read a file into a buffer
Definition at line 143 of file sbFileUtils.cpp.