#include "Stroika/Foundation/StroikaPreComp.h"
#include <filesystem>
#include "Stroika/Foundation/Characters/String.h"
#include "Stroika/Foundation/Execution/Synchronized.h"
#include "Stroika/Foundation/IO/FileSystem/Common.h"
#include "Stroika/Foundation/IO/FileSystem/FileStream.h"
#include "Stroika/Foundation/Streams/InputStream.h"
#include "FileInputStream.inl"
Go to the source code of this file.
- Note
- Code-Status: Beta
TODO:
Definition in file FileInputStream.h.
◆ Ptr
◆ BufferFlag
- Note
- We considered having a GetFD () method to retrieve the file descriptor, but that opened up too many possibilities for bugs (like changing the blocking nature of the IO). If you wish - you can always open the file descriptor yourself, track it yourself, and do what you will to it and pass it in, but then the results are 'on you.
Definition at line 47 of file FileInputStream.h.
◆ New()
The static New method is like a constructor, but it constructs a smart pointer of some appropriate subtype defined by its parameters.
The New overload with FileDescriptorType does an 'attach' - taking ownership (and thus later closing) the argument file descriptor.
- Precondition
- fd is a valid file descriptor (for that overload)
- Example Usage
static const filesystem::path kProcCPUInfoFileName_{"/proc/cpuinfo"sv};
Ptr stream = FileInputStream::New (kProcCPUInfoFileName_, FileInputStream::eNotSeekable);
- Example Usage
Ptr stdinStream = FileInputStream::New (0, AdoptFDPolicy::eDisconnectOnDestruction);
- Note
- Thread-Safety C++-Standard-Thread-Safety-For-Envelope-Plus-Must-Externally-Synchronize-Letter
Definition at line 281 of file FileInputStream.cpp.
◆ kBufferFlag_DEFAULT
constexpr BufferFlag Stroika::Foundation::IO::FileSystem::FileInputStream::kBufferFlag_DEFAULT = eUnbuffered |
|
constexpr |
- Note
- FileInputStream::kBufferFlag_DEFAULT defaults to eUnbuffered, because StreamReader generally provides a better buffering strategy.
Definition at line 66 of file FileInputStream.h.
◆ kSeekableFlag_DEFAULT
constexpr SeekableFlag Stroika::Foundation::IO::FileSystem::FileInputStream::kSeekableFlag_DEFAULT = SeekableFlag::eSeekable |
|
constexpr |
- Note
- - prior to v2.1d27, this defaulted to unseekable, but for files, it makes way more sense to default to seekable, since doing so typically costs nothing, and is pretty commonly useful.
Definition at line 72 of file FileInputStream.h.