Skip to main content

Common Fluids Format 2024 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.
 
 Error (const std::string &pErrorStr)
 Constructor, Error state with error message.
 
void addError (const std::string &pErrororStr)
 Add one error to the object.
 
void addWarning (const std::string &pWarningStr)
 Add one warning to the object (a OK state is still OK)
 
void addInfo (const std::string &pInfoStr)
 Add one info mesage to the object (a OK state is still OK)
 
void operator+= (const Error &pObj)
 Appends all info/warning/error states.
 
bool operator() () const
 Equivalent to ok()
 
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()
 
const std::vector< std::string > & getWarnings () const
 All warnings as a string vector.
 
const std::vector< std::string > & getInfos () const
 All info messages as a string vector.
 

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.

Member Function Documentation

◆ 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 )

◆ 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()

◆ 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

Connect with Ansys