From c7cf50a4e58107901af9da50ad9d9f4afd28909f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 13 Oct 2008 23:47:30 +0000 Subject: [PATCH] * Added a handy BDiskSystem::SupportsWriting(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28066 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/storage/DiskSystem.h | 1 + src/kits/storage/disk_device/DiskSystem.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/headers/private/storage/DiskSystem.h b/headers/private/storage/DiskSystem.h index 0f9c6d7f5e..017ba0cfeb 100644 --- a/headers/private/storage/DiskSystem.h +++ b/headers/private/storage/DiskSystem.h @@ -45,6 +45,7 @@ public: bool SupportsCreatingChild() const; bool SupportsDeletingChild() const; bool SupportsInitializing() const; + bool SupportsWriting() const; status_t GetTypeForContentType(const char* contentType, BString* type) const; diff --git a/src/kits/storage/disk_device/DiskSystem.cpp b/src/kits/storage/disk_device/DiskSystem.cpp index 0124a5bb33..7dffe31a99 100644 --- a/src/kits/storage/disk_device/DiskSystem.cpp +++ b/src/kits/storage/disk_device/DiskSystem.cpp @@ -290,6 +290,17 @@ BDiskSystem::SupportsInitializing() const } +bool +BDiskSystem::SupportsWriting() const +{ + if (InitCheck() != B_OK + || !IsFileSystem()) + return false; + + return (fFlags & B_DISK_SYSTEM_SUPPORTS_WRITING) != 0; +} + + // GetTypeForContentType status_t BDiskSystem::GetTypeForContentType(const char* contentType, BString* type) const