ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 25 of file textfile.hpp.

#include <textfile.hpp>

Inheritance diagram for TTextFile< TNString, TAllocator >:
[legend]
Collaboration diagram for 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 AllocatorMember< MonoAllocator >
using AllocatorType
 Exposes the allocator type.
 

Public Method Index:

 TTextFile (MonoAllocator &ma)
 
lang::system::SystemErrors Read (const CString &filePath)
 
lang::system::SystemErrors Read (files::File file)
 
ALIB_API lang::system::SystemErrors Write (const String &filePath)
 
- Public Method Index: inherited from 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 AllocatorMember< MonoAllocator >
MonoAllocatorallocator
 A reference to the allocator.
 

Type Definition Details:

◆ AllocatorType

template<typename TNString = NString, typename TAllocator = MonoAllocator>
using AllocatorType = TAllocator

Type definition publishing template parameter TAllocator.

Definition at line 34 of file textfile.hpp.

◆ StoredType

template<typename TNString = NString, typename TAllocator = MonoAllocator>
using 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 39 of file textfile.hpp.

◆ Vector

template<typename TNString = NString, typename TAllocator = MonoAllocator>
using Vector = StdVectorMono<TNString>

Type definition publishing the base container type.

Definition at line 42 of file textfile.hpp.

Field Details:

◆ allocator

template<typename TNString = NString, typename TAllocator = MonoAllocator>
MonoAllocator& allocator
protected

The given allocator.

Definition at line 30 of file textfile.hpp.

Constructor(s) / Destructor Details:

◆ TTextFile()

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

Constructor.

Parameters
maThe allocator to use.

Definition at line 47 of file textfile.hpp.

Method Details:

◆ Read() [1/2]

template<typename TNString = NString, typename TAllocator = MonoAllocator>
lang::system::SystemErrors 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 56 of file textfile.hpp.

Here is the call graph for this function:

◆ Read() [2/2]

template<typename TNString = NString, typename TAllocator = MonoAllocator>
lang::system::SystemErrors 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 87 of file textfile.hpp.

Here is the call graph for this function:

◆ Write()

template<typename TNString = NString, typename TAllocator = MonoAllocator>
ALIB_API lang::system::SystemErrors 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 99 of file textfile.hpp.


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