fcml  1.2.2
Public Member Functions | List of all members
fcml::ErrorContainer Class Reference

Wraps multiple errors into one component. More...

#include <fcml_errors.hpp>

Public Member Functions

 ErrorContainer ()
 Default constructor. More...
 
fcml_usize getSize () const
 Gets number of errors in the container. More...
 
const ErrorInfooperator[] (fcml_usize index) const
 Gets an error at given index. More...
 
ErrorInfooperator[] (fcml_usize index)
 Gets an error at given index. More...
 
void addErrorInfo (const ErrorInfo &errorInfo)
 Adds a new error into the container. More...
 
bool isError () const
 Returns true if there is any error in the container. More...
 
bool isWarn () const
 Returns true if there is any warning in the container. More...
 
bool isEmpty () const
 Gets true if there is any error or warning in the container. More...
 
const ErrorInfogetFirstError () const
 Returns the first error from the container. More...
 
ErrorInfogetFirstError ()
 Returns the first error from the container. More...
 
fcml_cstring getFirstErrorMessage () const
 Returns the first error message from the container. More...
 
fcml_cstring prepareErrorMessage (const fcml_cstring &message) const
 Prepares an error message basing on the first error in the container. More...
 
void clean ()
 Cleans all errors and warnings. More...
 

Detailed Description

Wraps multiple errors into one component.

Since
1.1.0

Constructor & Destructor Documentation

◆ ErrorContainer()

fcml::ErrorContainer::ErrorContainer ( )
inline

Default constructor.

Since
1.1.0

Member Function Documentation

◆ addErrorInfo()

void fcml::ErrorContainer::addErrorInfo ( const ErrorInfo errorInfo)
inline

Adds a new error into the container.

Parameters
errorInfoThe new error to add.
Since
1.1.0

◆ clean()

void fcml::ErrorContainer::clean ( )
inline

Cleans all errors and warnings.

Since
1.1.0

◆ getFirstError() [1/2]

const ErrorInfo& fcml::ErrorContainer::getFirstError ( ) const
inline

Returns the first error from the container.

Returns
The first error.
Exceptions
IllegalStateExceptionContainer is empty.
Since
1.1.0

◆ getFirstError() [2/2]

ErrorInfo& fcml::ErrorContainer::getFirstError ( )
inline

Returns the first error from the container.

Returns
The first error.
Exceptions
IllegalStateExceptionContainer is empty.
Since
1.1.0

◆ getFirstErrorMessage()

fcml_cstring fcml::ErrorContainer::getFirstErrorMessage ( ) const
inline

Returns the first error message from the container.

Returns
The first error message.
Since
1.1.0

◆ getSize()

fcml_usize fcml::ErrorContainer::getSize ( ) const
inline

Gets number of errors in the container.

Returns
The number of errors.
Since
1.1.0

◆ isEmpty()

bool fcml::ErrorContainer::isEmpty ( ) const
inline

Gets true if there is any error or warning in the container.

Returns
True if there is any error or warning in the container.
Since
1.1.0

◆ isError()

bool fcml::ErrorContainer::isError ( ) const
inline

Returns true if there is any error in the container.

Returns
True if there is any error in the container.
Since
1.1.0

◆ isWarn()

bool fcml::ErrorContainer::isWarn ( ) const
inline

Returns true if there is any warning in the container.

Returns
True if there is any warning in the container.
Since
1.1.0

◆ operator[]() [1/2]

const ErrorInfo& fcml::ErrorContainer::operator[] ( fcml_usize  index) const
inline

Gets an error at given index.

Parameters
indexThe error index.
Returns
The error at given index.
Exceptions
BadArgumentExceptionIf index is out of bound.
Since
1.1.0

◆ operator[]() [2/2]

ErrorInfo& fcml::ErrorContainer::operator[] ( fcml_usize  index)
inline

Gets an error at given index.

Parameters
indexThe error index.
Returns
The error at given index.
Since
1.1.0

◆ prepareErrorMessage()

fcml_cstring fcml::ErrorContainer::prepareErrorMessage ( const fcml_cstring message) const
inline

Prepares an error message basing on the first error in the container.

Parameters
messageA prefix for the destination error message.
Returns
Error message.
Since
1.1.0

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