ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::files::TTextFile< TNString, TAllocator > Class Template Reference

Description:

template<typename TNString = NString, typename TAllocator = MonoAllocator>
class alib::files::TTextFile< TNString, TAllocator >

A rather simple text file reader and writer.

Template Parameters
TNStringThe string-type. This may also be a type derived from NString which contains further fields available with each line of the file.
TAllocatorThe allocator type to use, as prototyped with Allocator.

Definition at line 27 of file ALib.Files.TextFile.H.

#include <ALib.Files.TextFile.H>

Inheritance diagram for alib::files::TTextFile< TNString, TAllocator >:
[legend]
Collaboration diagram for alib::files::TTextFile< TNString, TAllocator >:
[legend]

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< MonoAllocatorAI () const noexcept
 
MonoAllocatorGetAllocator () const noexcept
 

Protected Field Index:

MonoAllocatorallocator
 The given allocator.
 
- Protected Field Index: inherited from alib::lang::AllocatorMember< MonoAllocator >
MonoAllocatorallocator
 A reference to the allocator.
 

Type Definition Details:

◆ AllocatorType

template<typename TNString = NString, typename TAllocator = MonoAllocator>
using alib::files::TTextFile< TNString, TAllocator >::AllocatorType = TAllocator

Type definition publishing template parameter TAllocator.

Definition at line 36 of file ALib.Files.TextFile.H.

◆ StoredType

template<typename TNString = NString, typename TAllocator = MonoAllocator>
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.

◆ Vector

template<typename TNString = NString, typename TAllocator = MonoAllocator>
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.

Field Details:

◆ allocator

template<typename TNString = NString, typename TAllocator = MonoAllocator>
MonoAllocator& alib::files::TTextFile< TNString, TAllocator >::allocator
protected

The given allocator.

Definition at line 32 of file ALib.Files.TextFile.H.

Constructor(s) / Destructor Details:

◆ TTextFile()

template<typename TNString = NString, typename TAllocator = MonoAllocator>
alib::files::TTextFile< TNString, TAllocator >::TTextFile ( MonoAllocator & ma)
inline

Constructor.

Parameters
maThe allocator to use.

Definition at line 49 of file ALib.Files.TextFile.H.

Method Details:

◆ Read() [1/2]

template<typename TNString = NString, typename TAllocator = MonoAllocator>
system::SystemErrors alib::files::TTextFile< TNString, TAllocator >::Read ( const CString & filePath)
inline

Reads the file into this vector of lines.

Parameters
filePathThe path of the file.
Returns
SystemErrors::OK if all went well, otherwise an error code.

Definition at line 58 of file ALib.Files.TextFile.H.

◆ Read() [2/2]

template<typename TNString = NString, typename TAllocator = MonoAllocator>
system::SystemErrors alib::files::TTextFile< TNString, TAllocator >::Read ( files::File file)
inline

Reads the file into this vector of lines.

Parameters
fileThe file to read.
Returns
SystemErrors::OK if all went well, otherwise an error code.

Definition at line 90 of file ALib.Files.TextFile.H.

◆ Write()

template<typename TNString = NString, typename TAllocator = MonoAllocator>
ALIB_DLL system::SystemErrors alib::files::TTextFile< TNString, TAllocator >::Write ( const String & filePath)
inline

Writes this text file to the given filePath.

Parameters
filePathThe path of the file.
Returns
SystemErrors::OK if all went well, otherwise an error code.

Definition at line 102 of file ALib.Files.TextFile.H.


The documentation for this class was generated from the following file: