FileSystemFileEntry.h (1539B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_FileSystemFileEntry_h 8 #define mozilla_dom_FileSystemFileEntry_h 9 10 #include "mozilla/dom/FileSystemEntry.h" 11 12 namespace mozilla::dom { 13 14 class File; 15 class FileCallback; 16 class FileSystemDirectoryEntry; 17 18 class FileSystemFileEntry final : public FileSystemEntry { 19 public: 20 NS_DECL_ISUPPORTS_INHERITED 21 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileSystemFileEntry, FileSystemEntry) 22 23 FileSystemFileEntry(nsIGlobalObject* aGlobalObject, File* aFile, 24 FileSystemDirectoryEntry* aParentEntry, 25 FileSystem* aFileSystem); 26 27 virtual JSObject* WrapObject(JSContext* aCx, 28 JS::Handle<JSObject*> aGivenProto) override; 29 30 virtual bool IsFile() const override { return true; } 31 32 virtual void GetName(nsAString& aName, ErrorResult& aRv) const override; 33 34 virtual void GetFullPath(nsAString& aFullPath, 35 ErrorResult& aRv) const override; 36 37 void GetFile( 38 FileCallback& aSuccessCallback, 39 const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const; 40 41 private: 42 ~FileSystemFileEntry(); 43 44 RefPtr<File> mFile; 45 }; 46 47 } // namespace mozilla::dom 48 49 #endif // mozilla_dom_FileSystemFileEntry_h