27 #ifndef sbFileSystemTree_h_
28 #define sbFileSystemTree_h_
30 #include <nsAutoPtr.h>
31 #include <nsStringAPI.h>
32 #include <nsILocalFile.h>
33 #include <nsIThread.h>
40 #include "sbPIFileSystemTree.h"
63 NS_DECL_SBPIFILESYSTEMTREE
71 nsresult
Init(
const nsAString &
aPath, PRBool aIsRecursive);
130 PRBool aBuildDiscoveredDirArray,
131 PRBool aNotifyListener);
178 const nsAString & aNodePath,
202 nsAString & aFullPath);
214 nsAString & aFullPath);
297 nsRefPtr<sbFileSystemNode> mRootNode;
298 nsCOMPtr<nsIThread> mOwnerContextThread;
299 nsCOMPtr<nsILocalFile> mRootFile;
302 PRBool mIsRecursiveBuild;
303 PRBool mShouldLoadSession;
304 PRBool mIsIntialized;
305 PRLock *mRootNodeLock;
306 PRLock *mListenerLock;
309 nsID mSavedSessionID;
nsresult SetListener(sbFileSystemTreeListener *aListener)
nsresult NotifyDirAdded(sbFileSystemNode *aAddedDirNode, nsAString &aFullPath)
nsresult GetNode(const nsAString &aPath, sbFileSystemNode *aRootSearchNode, sbFileSystemNode **aNodeRetVal)
nsresult SaveTreeSession(const nsID &aSessionID)
static nsresult GetPathEntries(const nsAString &aPath, nsISimpleEnumerator **aResultEnum)
nsresult GetChildren(const nsAString &aPath, sbFileSystemNode *aParentNode, sbNodeMap &aNodeMap)
nsTArray< nsString > sbStringArray
void NotifyBuildComplete()
nsresult InitWithTreeSession(nsID &aSessionID)
nsresult GetNodeChanges(sbFileSystemNode *aNode, const nsAString &aNodePath, sbNodeChangeArray &aOutChangeArray)
void NotifySessionLoadError()
nsresult GetTreeChanges(sbFileSystemNode *aOldRootNode, sbPathChangeArray &aOutChangeArray)
NS_DECL_ISUPPORTS NS_DECL_SBPIFILESYSTEMTREE nsresult Init(const nsAString &aPath, PRBool aIsRecursive)
nsresult AddChildren(const nsAString &aPath, sbFileSystemNode *aParentNode, PRBool aBuildDiscoveredDirArray, PRBool aNotifyListener)
nsresult CreateNode(nsIFile *aFile, sbFileSystemNode *aParentNode, sbFileSystemNode **aNodeRetVal)
static nsresult AppendCreatePathChangeItem(const nsAString &aEventPath, EChangeType aChangeType, sbPathChangeArray &aChangeArray)
std::map< nsString, nsRefPtr< sbFileSystemNode > > sbNodeMap
void NotifyRootPathIsMissing()
nsresult NotifyDirRemoved(sbFileSystemNode *aRemovedDirNode, nsAString &aFullPath)
nsTArray< nsRefPtr< sbFileSystemPathChange > > sbPathChangeArray
virtual ~sbFileSystemTree()
nsTArray< nsRefPtr< sbFileSystemNodeChange > > sbNodeChangeArray
std::stack< NodeContext > sbNodeContextStack
static nsresult CompareNodes(sbFileSystemNode *aNode1, sbFileSystemNode *aNode2, PRBool *aIsSame)
nsresult Update(const nsAString &aPath)
nsString EnsureTrailingPath(const nsAString &aFilePath)
nsresult CreateTreeEvents(sbNodeContextStack &aContextStack, EChangeType aChangeType, sbPathChangeArray &aChangeArray)
static nsresult AppendCreateNodeChangeItem(sbFileSystemNode *aChangedNode, EChangeType aChangeType, sbNodeChangeArray &aChangeArray)