A rather simple text file reader and writer.
| TNString | The string-type. This may also be a type derived from NString which contains further fields available with each line of the file. |
| TAllocator | The allocator type to use, as prototyped with Allocator. |
Definition at line 27 of file ALib.Files.TextFile.H.
#include <ALib.Files.TextFile.H>
Public Type Index: | |
| using | AllocatorType = TAllocator |
| Type definition publishing template parameter TAllocator. | |
| using | StoredType = TNString |
| using | Vector = StdVectorMono<TNString> |
| Type definition publishing the base container type. | |
Public Type Index: inherited from alib::lang::AllocatorMember< MonoAllocator > | |
| using | AllocatorType |
| Exposes the allocator type. | |
Public Method Index: | |
| TTextFile (MonoAllocator &ma) | |
| system::SystemErrors | Read (const CString &filePath) |
| system::SystemErrors | Read (files::File file) |
| ALIB_DLL system::SystemErrors | Write (const String &filePath) |
Public Method Index: inherited from alib::lang::AllocatorMember< MonoAllocator > | |
| AllocatorMember ()=delete | |
| Deleted default constructor. (The allocator has to be given with construction) | |
| AllocatorMember (MonoAllocator &pAllocator) noexcept | |
| AllocatorInterface< MonoAllocator > | AI () const noexcept |
| MonoAllocator & | GetAllocator () const noexcept |
Protected Field Index: | |
| MonoAllocator & | allocator |
| The given allocator. | |
Protected Field Index: inherited from alib::lang::AllocatorMember< MonoAllocator > | |
| MonoAllocator & | allocator |
| A reference to the allocator. | |
| using alib::files::TTextFile< TNString, TAllocator >::AllocatorType = TAllocator |
Type definition publishing template parameter TAllocator.
Definition at line 36 of file ALib.Files.TextFile.H.
| using alib::files::TTextFile< TNString, TAllocator >::StoredType = TNString |
Type definition publishing the type in the std::vector that this type is derived of. (As is defined with template parameter TNString.)
Definition at line 41 of file ALib.Files.TextFile.H.
| using alib::files::TTextFile< TNString, TAllocator >::Vector = StdVectorMono<TNString> |
Type definition publishing the base container type.
Definition at line 44 of file ALib.Files.TextFile.H.
|
protected |
The given allocator.
Definition at line 32 of file ALib.Files.TextFile.H.
|
inline |
Constructor.
| ma | The allocator to use. |
Definition at line 49 of file ALib.Files.TextFile.H.
|
inline |
Reads the file into this vector of lines.
| filePath | The path of the file. |
Definition at line 58 of file ALib.Files.TextFile.H.
|
inline |
Reads the file into this vector of lines.
| file | The file to read. |
Definition at line 90 of file ALib.Files.TextFile.H.
|
inline |
Writes this text file to the given filePath.
| filePath | The path of the file. |
Definition at line 102 of file ALib.Files.TextFile.H.