blob: f6957e9e61d2ca3a3c629181814e513bed0fd6d7 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include <string_view>
#include "src/storage/factory/factoryfs/format.h"
namespace factoryfs {
class DirectoryEntryManager final {
DirectoryEntryManager(const DirectoryEntryManager&) = delete;
DirectoryEntryManager(DirectoryEntryManager&&) = delete;
DirectoryEntryManager& operator=(const DirectoryEntryManager&) = delete;
DirectoryEntryManager& operator=(DirectoryEntryManager&&) = delete;
static zx_status_t Create(const DirectoryEntry* entry,
std::unique_ptr<DirectoryEntryManager>* out);
// Gets size of file data.
uint32_t GetDataSize() const;
// Gets device block number of start of file data.
uint32_t GetDataStart() const;
// Gets filename.
std::string_view GetName() const;
// Gets filename length.
uint32_t GetNameLen() const;
DirectoryEntryManager(const DirectoryEntry* entry);
const DirectoryEntry& entry() const;
std::unique_ptr<uint32_t[]> buffer_;
} // namespace factoryfs