summaryrefslogtreecommitdiffstats
path: root/rdf/datasource/nsFileSystemDataSource.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /rdf/datasource/nsFileSystemDataSource.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'rdf/datasource/nsFileSystemDataSource.h')
-rw-r--r--rdf/datasource/nsFileSystemDataSource.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/rdf/datasource/nsFileSystemDataSource.h b/rdf/datasource/nsFileSystemDataSource.h
new file mode 100644
index 000000000..09fa17400
--- /dev/null
+++ b/rdf/datasource/nsFileSystemDataSource.h
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef nsFileSystemDataSource_h__
+#define nsFileSystemDataSource_h__
+
+#include "nsIRDFDataSource.h"
+#include "nsIRDFLiteral.h"
+#include "nsIRDFResource.h"
+#include "nsIRDFService.h"
+#include "nsCOMPtr.h"
+#include "nsString.h"
+#include "mozilla/Attributes.h"
+
+#if defined(XP_UNIX) || defined(XP_WIN)
+#define USE_NC_EXTENSION
+#endif
+
+class FileSystemDataSource final : public nsIRDFDataSource
+{
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIRDFDATASOURCE
+
+ static nsresult Create(nsISupports* aOuter,
+ const nsIID& aIID, void **aResult);
+
+ nsresult Init();
+
+private:
+ FileSystemDataSource() { }
+ ~FileSystemDataSource() { }
+
+ // helper methods
+ bool isFileURI(nsIRDFResource* aResource);
+ bool isDirURI(nsIRDFResource* aSource);
+ nsresult GetVolumeList(nsISimpleEnumerator **aResult);
+ nsresult GetFolderList(nsIRDFResource *source, bool allowHidden, bool onlyFirst, nsISimpleEnumerator **aResult);
+ nsresult GetName(nsIRDFResource *source, nsIRDFLiteral** aResult);
+ nsresult GetURL(nsIRDFResource *source, bool *isFavorite, nsIRDFLiteral** aResult);
+ nsresult GetFileSize(nsIRDFResource *source, nsIRDFInt** aResult);
+ nsresult GetLastMod(nsIRDFResource *source, nsIRDFDate** aResult);
+
+ nsCOMPtr<nsIRDFService> mRDFService;
+
+ // pseudo-constants
+ nsCOMPtr<nsIRDFResource> mNC_FileSystemRoot;
+ nsCOMPtr<nsIRDFResource> mNC_Child;
+ nsCOMPtr<nsIRDFResource> mNC_Name;
+ nsCOMPtr<nsIRDFResource> mNC_URL;
+ nsCOMPtr<nsIRDFResource> mNC_Icon;
+ nsCOMPtr<nsIRDFResource> mNC_Length;
+ nsCOMPtr<nsIRDFResource> mNC_IsDirectory;
+ nsCOMPtr<nsIRDFResource> mWEB_LastMod;
+ nsCOMPtr<nsIRDFResource> mNC_FileSystemObject;
+ nsCOMPtr<nsIRDFResource> mNC_pulse;
+ nsCOMPtr<nsIRDFResource> mRDF_InstanceOf;
+ nsCOMPtr<nsIRDFResource> mRDF_type;
+
+ nsCOMPtr<nsIRDFLiteral> mLiteralTrue;
+ nsCOMPtr<nsIRDFLiteral> mLiteralFalse;
+
+#ifdef USE_NC_EXTENSION
+ nsresult GetExtension(nsIRDFResource *source, nsIRDFLiteral** aResult);
+ nsCOMPtr<nsIRDFResource> mNC_extension;
+#endif
+
+#ifdef XP_WIN
+ bool isValidFolder(nsIRDFResource *source);
+ nsresult getIEFavoriteURL(nsIRDFResource *source, nsString aFileURL, nsIRDFLiteral **urlLiteral);
+ nsCOMPtr<nsIRDFResource> mNC_IEFavoriteObject;
+ nsCOMPtr<nsIRDFResource> mNC_IEFavoriteFolder;
+ nsCString ieFavoritesDir;
+#endif
+};
+
+#endif // nsFileSystemDataSource_h__