Files
sphaira/sphaira/include/yati/source/stream_file.hpp
ITotalJustice a9931a975d many more optimisations. cleaned up fs code. bug fixes etc (see below).
- fix usb using the wrong year when polling the timestamp.
- fs file/dir has been re-written to allow for simplified calling and remove the need of manually closing.
- add SetSize for stdio by using ftruncate.
- don't truncate the file when opened in stdio.
- add getcount api for stdio.
- display file/dir count in filebrowser for non-native fs.
- allow hash to be used on non-native fs.
- slightly optimise nro parsing by manually calculating nro size rather than doing an os call.
- slightly optimise nro parsing by keeping the fs struct alive between calls, rather than creating a new one on the stack.
- fix filebrowser peeking into zip files that are stored on non-sd fs.
- set the timestamp of a file moved to a stdio location (cut/paste).
- slightly optimise daybreak update folder detection by skipping opening/polling the dir size.
- set the fullpath of the file thats being hashed in progress box.
2025-05-26 17:06:04 +01:00

23 lines
547 B
C++

// this is used for testing that streams work, this code isn't used in normal
// release builds as it is slower / less feature complete than normal.
#pragma once
#include "stream.hpp"
#include "fs.hpp"
#include <switch.h>
#include <memory>
namespace sphaira::yati::source {
struct StreamFile final : Stream {
StreamFile(fs::Fs* fs, const fs::FsPath& path);
Result ReadChunk(void* buf, s64 size, u64* bytes_read) override;
private:
fs::Fs* m_fs{};
fs::File m_file{};
s64 m_offset{};
};
} // namespace sphaira::yati::source