libxcks  0.1.0.1
libxcks::XCKSReader Class Reference

XCKS file reader. More...

#include <xcksreader.hpp>

Inheritance diagram for libxcks::XCKSReader:
Collaboration diagram for libxcks::XCKSReader:

Public Member Functions

 XCKSReader ()=delete
 Deleted default constructor. More...
 
 XCKSReader (const XCKSReader &)=delete
 Deleted copy constructor. More...
 
XCKSReaderoperator= (const XCKSReader &)=delete
 Deleted copy assignment operator. More...
 
 XCKSReader (XCKSReaderHandler &xcksReaderHandler)
 Constructor. More...
 
virtual ~XCKSReader ()
 Destructor. More...
 
virtual bool parse (std::istream &is, const std::filesystem::path &basePath)
 Parses an XCKS file from an input stream. More...
 
virtual bool parse (const std::filesystem::path &fileFullPath)
 Parses an XCKS file from a file. More...
 
virtual bool parse (const std::filesystem::path &filePath, const std::filesystem::path &basePath)
 Parses an XCKS file from a file and a base path. More...
 

Static Public Member Functions

static bool parseXCKS (XCKSReaderHandler &xcksReaderHandler, std::istream &is, const std::filesystem::path &basePath)
 Convenience method for parsing an XCKS file from an input stream. More...
 
static bool parseXCKS (XCKSReaderHandler &xcksReaderHandler, const std::filesystem::path &fileFullPath)
 Convenience method for parsing an XCKS file from a file. More...
 
static bool parseXCKS (XCKSReaderHandler &xcksReaderHandler, const std::filesystem::path &filePath, const std::filesystem::path &basePath)
 Convenience method for parsing an XCKS file from a file and a base path. More...
 

Protected Attributes

XCKSReaderHandlerreaderHandler
 The XCKS file reader handler. More...
 

Detailed Description

XCKS file reader.

Definition at line 45 of file xcksreader.hpp.

Constructor & Destructor Documentation

◆ XCKSReader() [1/3]

libxcks::XCKSReader::XCKSReader ( )
delete

Deleted default constructor.

◆ XCKSReader() [2/3]

libxcks::XCKSReader::XCKSReader ( const XCKSReader )
delete

Deleted copy constructor.

◆ XCKSReader() [3/3]

libxcks::XCKSReader::XCKSReader ( XCKSReaderHandler xcksReaderHandler)

Constructor.

Parameters
[in]xcksReaderHandlerThe XCKS file reader handler.

Definition at line 55 of file xcksreader.cpp.

◆ ~XCKSReader()

libxcks::XCKSReader::~XCKSReader ( )
virtual

Destructor.

Definition at line 64 of file xcksreader.cpp.

Member Function Documentation

◆ operator=()

XCKSReader& libxcks::XCKSReader::operator= ( const XCKSReader )
delete

Deleted copy assignment operator.

◆ parse() [1/3]

bool libxcks::XCKSReader::parse ( const std::filesystem::path &  fileFullPath)
virtual

Parses an XCKS file from a file.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in]fileFullPathThe path of the file to parse. This path must be an absolute path.
Returns
true if the XCKS file has been successfully read from the given file, false otherwise.

Definition at line 91 of file xcksreader.cpp.

◆ parse() [2/3]

bool libxcks::XCKSReader::parse ( const std::filesystem::path &  filePath,
const std::filesystem::path &  basePath 
)
virtual

Parses an XCKS file from a file and a base path.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in]filePathThe path of the file to parse. This path can be an absolute path or relative path.
[in]basePathThe base path of the read XCKS file. It is independent from filePath. This path must be an absolute path of a directory and must ends with a path separator.
Returns
true if the XCKS file has been successfully read from the given file and base path, false otherwise.

Definition at line 116 of file xcksreader.cpp.

◆ parse() [3/3]

bool libxcks::XCKSReader::parse ( std::istream &  is,
const std::filesystem::path &  basePath 
)
virtual

Parses an XCKS file from an input stream.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in,out]isThe input stream.
[in]basePathThe base path of the read XCKS file. This path must be an absolute path of a directory and must ends with a path separator.
Returns
true if the XCKS file has been successfully read from the given stream, false otherwise.

Reimplemented in libxcks::ZXCKSReader.

Definition at line 73 of file xcksreader.cpp.

◆ parseXCKS() [1/3]

bool libxcks::XCKSReader::parseXCKS ( XCKSReaderHandler xcksReaderHandler,
const std::filesystem::path &  fileFullPath 
)
static

Convenience method for parsing an XCKS file from a file.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in]xcksReaderHandlerThe XCKS file reader handler.
[in]fileFullPathThe path of the file to parse. This path must be an absolute path.
Returns
true if the XCKS file has been successfully read from the given file, false otherwise.

Definition at line 154 of file xcksreader.cpp.

◆ parseXCKS() [2/3]

bool libxcks::XCKSReader::parseXCKS ( XCKSReaderHandler xcksReaderHandler,
const std::filesystem::path &  filePath,
const std::filesystem::path &  basePath 
)
static

Convenience method for parsing an XCKS file from a file and a base path.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in]xcksReaderHandlerThe XCKS file reader handler.
[in]filePathThe path of the file to parse. This path can be an absolute path or relative path.
[in]basePathThe base path of the read XCKS file. It is independent from filePath. This path must be an absolute path of a directory and must ends with a path separator.
Returns
true if the XCKS file has been successfully read from the given file and base path, false otherwise.

Definition at line 166 of file xcksreader.cpp.

◆ parseXCKS() [3/3]

bool libxcks::XCKSReader::parseXCKS ( XCKSReaderHandler xcksReaderHandler,
std::istream &  is,
const std::filesystem::path &  basePath 
)
static

Convenience method for parsing an XCKS file from an input stream.

Note
Errors must be handled in XCKSReaderHandler::onFatalError (the provided XCKS file reader's handler).
Parameters
[in]xcksReaderHandlerThe XCKS file reader handler.
[in,out]isThe input stream.
[in]basePathThe base path of the read XCKS file. This path must be an absolute path of a directory and must ends with a path separator.
Returns
true if the XCKS file has been successfully read from the given stream, false otherwise.

Definition at line 142 of file xcksreader.cpp.

Member Data Documentation

◆ readerHandler

XCKSReaderHandler& libxcks::XCKSReader::readerHandler
protected

The XCKS file reader handler.

Definition at line 48 of file xcksreader.hpp.


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