Skip to main content

Common Fluids Format 2025 R2

ansys::Project::Error Class Reference

Last update: 16.07.2025

The return state / error value of a Project function call. More...

#include "Error.hpp"

Public Member Functions

 Error ()
 Constructor, OK state. More...
 
 Error (const std::string &pErrorStr)
 Constructor, Error state with error message. More...
 
void addError (const std::string &pErrororStr)
 Add one error to the object. More...
 
void addWarning (const std::string &pWarningStr)
 Add one warning to the object (a OK state is still OK) More...
 
void addInfo (const std::string &pInfoStr)
 Add one info mesage to the object (a OK state is still OK) More...
 
void operator+= (const Error &pObj)
 Appends all info/warning/error states. More...
 
bool operator() () const
 Equivalent to ok() More...
 
bool ok () const
 True if no error message. More...
 
std::string getErrorsString () const
 All errors as a single string. More...
 
std::string getAllString () const
 All messages as a single string. More...
 
const std::vector< std::string > & getErrors () const
 All errors as a string vector. Empty if ok() More...
 
const std::vector< std::string > & getWarnings () const
 All warnings as a string vector. More...
 
const std::vector< std::string > & getInfos () const
 All info messages as a string vector. More...
 

Detailed Description

The return state / error value of a Project function call.

The Error object gathers the ok or error state of a project function call.

If there is no error ok() returns true. A ok state might provide information (getInfo()) or warning (getWarning()) messages.

If there is an error ( ok() returns false ) there is at least one error message.

Constructor & Destructor Documentation

◆ Error() [1/2]

ansys::Project::Error::Error ( )

Constructor, OK state.

◆ Error() [2/2]

ansys::Project::Error::Error ( const std::string &  pErrorStr)

Constructor, Error state with error message.

Member Function Documentation

◆ addError()

void ansys::Project::Error::addError ( const std::string &  pErrororStr)

Add one error to the object.

◆ addInfo()

void ansys::Project::Error::addInfo ( const std::string &  pInfoStr)

Add one info mesage to the object (a OK state is still OK)

◆ addWarning()

void ansys::Project::Error::addWarning ( const std::string &  pWarningStr)

Add one warning to the object (a OK state is still OK)

◆ getAllString()

std::string ansys::Project::Error::getAllString ( ) const

All messages as a single string.

Each type of messages as a separate line prefixed by the appropriate type ( Error: , Warning: , Information )

◆ getErrors()

const std::vector< std::string > & ansys::Project::Error::getErrors ( ) const

All errors as a string vector. Empty if ok()

◆ getErrorsString()

std::string ansys::Project::Error::getErrorsString ( ) const

All errors as a single string.

All errors as a single string, with separate lines for each error. Empty string if ok()

◆ getInfos()

const std::vector< std::string > & ansys::Project::Error::getInfos ( ) const

All info messages as a string vector.

◆ getWarnings()

const std::vector< std::string > & ansys::Project::Error::getWarnings ( ) const

All warnings as a string vector.

◆ ok()

bool ansys::Project::Error::ok ( ) const

True if no error message.

If false, there is at least one error message. If true, there might be information or warning messages

◆ operator()()

bool ansys::Project::Error::operator() ( ) const

Equivalent to ok()

◆ operator+=()

void ansys::Project::Error::operator+= ( const Error pObj)

Appends all info/warning/error states.

Connect with Ansys