本文整理汇总了C++中ArchiveBackend类的典型用法代码示例。如果您正苦于以下问题:C++ ArchiveBackend类的具体用法?C++ ArchiveBackend怎么用?C++ ArchiveBackend使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArchiveBackend类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFileInArchive
ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_HANDLE;
return archive->CreateFile(path, file_size);
}
示例2: CreateDirectoryFromArchive
ResultCode CreateDirectoryFromArchive(ArchiveHandle archive_handle, const FileSys::Path& path) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_ARCHIVE_HANDLE;
return archive->CreateDirectory(path);
}
示例3: DeleteFileFromArchive
ResultCode DeleteFileFromArchive(ArchiveHandle archive_handle, const FileSys::Path& path) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_ARCHIVE_HANDLE;
return archive->DeleteFile(path);
}
示例4: GetArchive
ResultCode ArchiveManager::CreateFileInArchive(ArchiveHandle archive_handle,
const FileSys::Path& path, u64 file_size) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return FileSys::ERR_INVALID_ARCHIVE_HANDLE;
return archive->CreateFile(path, file_size);
}
示例5: CreateDirectoryFromArchive
ResultCode CreateDirectoryFromArchive(ArchiveHandle archive_handle, const FileSys::Path& path) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_HANDLE;
if (archive->CreateDirectory(path))
return RESULT_SUCCESS;
return ResultCode(ErrorDescription::NoData, ErrorModule::FS, // TODO: verify description
ErrorSummary::Canceled, ErrorLevel::Status);
}
示例6: OpenFileFromArchive
ResultVal<std::shared_ptr<File>> OpenFileFromArchive(ArchiveHandle archive_handle,
const FileSys::Path& path,
const FileSys::Mode mode) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_ARCHIVE_HANDLE;
auto backend = archive->OpenFile(path, mode);
if (backend.Failed())
return backend.Code();
auto file = std::shared_ptr<File>(new File(backend.MoveFrom(), path));
return MakeResult<std::shared_ptr<File>>(std::move(file));
}
示例7: OpenDirectoryFromArchive
ResultVal<Kernel::SharedPtr<Directory>> OpenDirectoryFromArchive(ArchiveHandle archive_handle,
const FileSys::Path& path) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_HANDLE;
std::unique_ptr<FileSys::DirectoryBackend> backend = archive->OpenDirectory(path);
if (backend == nullptr) {
return ResultCode(ErrorDescription::NotFound, ErrorModule::FS,
ErrorSummary::NotFound, ErrorLevel::Permanent);
}
auto directory = Kernel::SharedPtr<Directory>(new Directory(std::move(backend), path));
return MakeResult<Kernel::SharedPtr<Directory>>(std::move(directory));
}
示例8: OpenFileFromArchive
ResultVal<Kernel::SharedPtr<File>> OpenFileFromArchive(ArchiveHandle archive_handle,
const FileSys::Path& path, const FileSys::Mode mode) {
ArchiveBackend* archive = GetArchive(archive_handle);
if (archive == nullptr)
return ERR_INVALID_HANDLE;
std::unique_ptr<FileSys::FileBackend> backend = archive->OpenFile(path, mode);
if (backend == nullptr) {
return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS,
ErrorSummary::NotFound, ErrorLevel::Status);
}
auto file = Kernel::SharedPtr<File>(new File(std::move(backend), path));
return MakeResult<Kernel::SharedPtr<File>>(std::move(file));
}