sbWatchFolderUtils.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2009 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef sbWatchFolderUtils_h_
26 #define sbWatchFolderUtils_h_
27 
28 #include <nsCOMPtr.h>
29 #include <nsStringAPI.h>
30 
32 
33 
34 //==============================================================================
35 //
36 // @interface sbAutoIgnoreWatchFolderPath
37 // @brief A class to automatically set and remove an ignored path with the
38 // watch folder service when the class goes out of scope.
39 //
40 //==============================================================================
41 
43 {
44 public:
47 
49 
50  //
51  // @brief Initialize an auto-release path with the watch folder service. This
52  // method will add the passed in file path to the ignore list on the
53  // watch folder service and remove the ignore path when the object is
54  // destructed.
55  //
56  nsresult Init(nsAString const & aWatchPath);
57 
58 private:
59  nsCOMPtr<sbIWatchFolderService> mWFService;
60  nsString mWatchPath;
61  PRBool mIsIgnoring;
62 };
63 
64 #endif // sbWatchFolderUtils_h_
65 
NS_DECL_ISUPPORTS nsresult Init(nsAString const &aWatchPath)