mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Allow probing of the filesystem capabilities.
This commit is contained in:
@@ -114,6 +114,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_LIST | OP_GETFILE | OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata()
|
||||
{
|
||||
AcornDfsDirectory dir(this);
|
||||
|
||||
@@ -56,6 +56,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_CREATE | OP_LIST | OP_GETFILE | OP_PUTFILE |
|
||||
OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata() override
|
||||
{
|
||||
AdfMount m(this);
|
||||
|
||||
@@ -195,6 +195,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_LIST | OP_GETFILE | OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata() override
|
||||
{
|
||||
Directory dir(this);
|
||||
|
||||
@@ -82,6 +82,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_LIST | OP_GETFILE | OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata() override
|
||||
{
|
||||
mount();
|
||||
|
||||
@@ -36,6 +36,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_CREATE | OP_LIST | OP_GETFILE | OP_PUTFILE |
|
||||
OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata() override
|
||||
{
|
||||
mount();
|
||||
|
||||
@@ -24,6 +24,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t capabilities() const
|
||||
{
|
||||
return OP_GETFSDATA | OP_CREATE | OP_LIST | OP_GETFILE | OP_PUTFILE |
|
||||
OP_GETDIRENT;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getMetadata() override
|
||||
{
|
||||
HfsMount m(this);
|
||||
|
||||
@@ -54,6 +54,11 @@ std::string Path::to_str(const std::string sep) const
|
||||
return join(*this, sep);
|
||||
}
|
||||
|
||||
uint32_t Filesystem::capabilities() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Filesystem::create(bool quick, const std::string& volumeName)
|
||||
{
|
||||
throw UnimplementedFilesystemException();
|
||||
|
||||
@@ -112,7 +112,25 @@ public:
|
||||
static constexpr const char* USED_BLOCKS = "used_blocks";
|
||||
static constexpr const char* BLOCK_SIZE = "block_size";
|
||||
|
||||
enum
|
||||
{
|
||||
OP_CREATE = 0b0000000000000001,
|
||||
OP_CHECK = 0b0000000000000010,
|
||||
OP_LIST = 0b0000000000000100,
|
||||
OP_GETFILE = 0b0000000000001000,
|
||||
OP_PUTFILE = 0b0000000000010000,
|
||||
OP_GETDIRENT = 0b0000000000100000,
|
||||
OP_CREATEDIR = 0b0000000001000000,
|
||||
OP_DELETE = 0b0000000010000000,
|
||||
OP_GETFSDATA = 0b0000000100000000,
|
||||
OP_PUTFSDATA = 0b0000001000000000,
|
||||
OP_PUTATTRS = 0b0000010000000000,
|
||||
};
|
||||
|
||||
public:
|
||||
/* Retrieve capability information. */
|
||||
virtual uint32_t capabilities() const;
|
||||
|
||||
/* Create a filesystem on the disk. */
|
||||
virtual void create(bool quick, const std::string& volmeName);
|
||||
|
||||
|
||||
@@ -886,19 +886,29 @@ public:
|
||||
browserToolbar->EnableTool(
|
||||
browserBackTool->GetId(), _state == STATE_BROWSING_IDLE);
|
||||
|
||||
browserToolbar->EnableTool(
|
||||
browserInfoTool->GetId(), selection.size() == 1);
|
||||
browserToolbar->EnableTool(
|
||||
browserOpenTool->GetId(), selection.size() == 1);
|
||||
browserToolbar->EnableTool(
|
||||
browserSaveTool->GetId(), selection.size() >= 1);
|
||||
browserToolbar->EnableTool(
|
||||
browserNewTool->GetId(), selection.size() <= 1);
|
||||
browserToolbar->EnableTool(
|
||||
browserNewDirectoryTool->GetId(), selection.size() <= 1);
|
||||
browserToolbar->EnableTool(
|
||||
browserDeleteTool->GetId(), selection.size() >= 1);
|
||||
browserToolbar->EnableTool(browserFormatTool->GetId(), false);
|
||||
uint32_t capabilities =
|
||||
_filesystem ? _filesystem->capabilities() : 0;
|
||||
|
||||
browserToolbar->EnableTool(browserInfoTool->GetId(),
|
||||
(capabilities & Filesystem::OP_GETDIRENT) &&
|
||||
(selection.size() == 1));
|
||||
browserToolbar->EnableTool(browserOpenTool->GetId(),
|
||||
(capabilities & Filesystem::OP_GETFILE) &&
|
||||
(selection.size() == 1));
|
||||
browserToolbar->EnableTool(browserSaveTool->GetId(),
|
||||
(capabilities & Filesystem::OP_GETFILE) &&
|
||||
(selection.size() >= 1));
|
||||
browserToolbar->EnableTool(browserNewTool->GetId(),
|
||||
(capabilities & Filesystem::OP_PUTFILE) &&
|
||||
(selection.size() <= 1));
|
||||
browserToolbar->EnableTool(browserNewDirectoryTool->GetId(),
|
||||
(capabilities & Filesystem::OP_CREATEDIR) &&
|
||||
(selection.size() <= 1));
|
||||
browserToolbar->EnableTool(browserDeleteTool->GetId(),
|
||||
(capabilities & Filesystem::OP_DELETE) &&
|
||||
(selection.size() >= 1));
|
||||
browserToolbar->EnableTool(browserFormatTool->GetId(),
|
||||
capabilities & Filesystem::OP_CREATE);
|
||||
}
|
||||
|
||||
Refresh();
|
||||
|
||||
Reference in New Issue
Block a user