/* -*- 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/. */
// aFileSystem can be null. In this case we create a OSFileSystem when needed. if (aFileSystem) { // More likely, this is a OSFileSystem. This object keeps a reference of // mGlobal but it's not cycle collectable and to avoid manual // addref/release, it's better to have 1 object per directory. For this // reason we clone it here.
mFileSystem = aFileSystem->Clone();
}
}
RefPtr<FileSystemBase> fs = GetFileSystem(aRv); if (NS_WARN_IF(aRv.Failed())) { return;
}
fs->GetDirectoryName(mFile, aRetval, aRv);
}
void Directory::GetPath(nsAString& aRetval, ErrorResult& aRv) { // This operation is expensive. Better to cache the result. if (mPath.IsEmpty()) {
RefPtr<FileSystemBase> fs = GetFileSystem(aRv); if (NS_WARN_IF(aRv.Failed())) { return;
}
fs->GetDOMPath(mFile, mPath, aRv); if (NS_WARN_IF(aRv.Failed())) { return;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.