2016-06-07 01:55:16 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
2016-08-18 10:17:48 +03:00
|
|
|
#ifndef mozilla_dom_FileSystemFileEntry_h
|
|
|
|
#define mozilla_dom_FileSystemFileEntry_h
|
2016-06-07 01:55:16 +03:00
|
|
|
|
2016-08-18 10:17:25 +03:00
|
|
|
#include "mozilla/dom/FileSystemEntry.h"
|
2016-06-07 01:55:16 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2016-11-03 09:55:30 +03:00
|
|
|
class File;
|
2016-11-03 09:57:34 +03:00
|
|
|
class FileCallback;
|
2016-11-03 09:55:30 +03:00
|
|
|
class FileSystemDirectoryEntry;
|
2016-06-07 01:55:16 +03:00
|
|
|
|
2016-08-18 10:17:48 +03:00
|
|
|
class FileSystemFileEntry final : public FileSystemEntry
|
2016-06-07 01:55:16 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-06-07 01:55:16 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2016-08-18 10:17:48 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileSystemFileEntry, FileSystemEntry)
|
2016-06-07 01:55:16 +03:00
|
|
|
|
2016-08-18 10:17:48 +03:00
|
|
|
FileSystemFileEntry(nsIGlobalObject* aGlobalObject, File* aFile,
|
2016-11-03 09:55:30 +03:00
|
|
|
FileSystemDirectoryEntry* aParentEntry,
|
2016-08-18 10:17:48 +03:00
|
|
|
FileSystem* aFileSystem);
|
2016-06-07 01:55:16 +03:00
|
|
|
|
|
|
|
virtual JSObject*
|
|
|
|
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
2016-06-07 01:55:16 +03:00
|
|
|
virtual bool
|
|
|
|
IsFile() const override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
GetName(nsAString& aName, ErrorResult& aRv) const override;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
GetFullPath(nsAString& aFullPath, ErrorResult& aRv) const override;
|
|
|
|
|
2016-06-07 01:55:16 +03:00
|
|
|
void
|
2016-11-03 09:57:34 +03:00
|
|
|
GetFile(FileCallback& aSuccessCallback,
|
2016-06-07 01:55:17 +03:00
|
|
|
const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const;
|
2016-06-07 01:55:16 +03:00
|
|
|
|
|
|
|
private:
|
2016-08-18 10:17:48 +03:00
|
|
|
~FileSystemFileEntry();
|
2016-06-07 01:55:16 +03:00
|
|
|
|
|
|
|
RefPtr<File> mFile;
|
2016-06-07 01:55:16 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-08-18 10:17:48 +03:00
|
|
|
#endif // mozilla_dom_FileSystemFileEntry_h
|