Structured validation result with errors and warnings.
More...
#include <ValidationResult.hpp>
|
| | ValidationResult ()=default |
| bool | IsValid () const |
| | Check if validation passed (no errors).
|
| std::vector< std::string > | GetErrors () const |
| | Get all error messages.
|
| std::vector< std::string > | GetWarnings () const |
| | Get all warning messages.
|
| std::vector< std::string > | GetInfos () const |
| | Get all info messages.
|
| const std::vector< ValidationIssue > & | GetIssues () const |
| | Get all issues.
|
| void | AddError (const std::string &message, const std::string &context="") |
| | Add an error.
|
| void | AddWarning (const std::string &message, const std::string &context="") |
| | Add a warning.
|
| void | AddInfo (const std::string &message, const std::string &context="") |
| | Add an info message.
|
| bool | HasIssues () const |
| | Check if there are any issues at all.
|
| size_t | ErrorCount () const |
| | Get error count.
|
| size_t | WarningCount () const |
| | Get warning count.
|
Structured validation result with errors and warnings.
Used for recording validation before warmstart and other validation checks.
Example:
for (
const auto& error : result.
GetErrors()) {
std::cerr << "Error: " << error << std::endl;
}
throw WarmstartError("Recording incompatible");
}
std::cerr << "Warning: " << warning << std::endl;
}
std::vector< std::string > GetErrors() const
Get all error messages.
Definition ValidationResult.hpp:73
ValidationResult()=default
bool IsValid() const
Check if validation passed (no errors).
Definition ValidationResult.hpp:63
std::vector< std::string > GetWarnings() const
Get all warning messages.
Definition ValidationResult.hpp:84
◆ ValidationResult()
| icarus::ValidationResult::ValidationResult |
( |
| ) |
|
|
default |
◆ AddError()
| void icarus::ValidationResult::AddError |
( |
const std::string & | message, |
|
|
const std::string & | context = "" ) |
|
inline |
◆ AddInfo()
| void icarus::ValidationResult::AddInfo |
( |
const std::string & | message, |
|
|
const std::string & | context = "" ) |
|
inline |
◆ AddWarning()
| void icarus::ValidationResult::AddWarning |
( |
const std::string & | message, |
|
|
const std::string & | context = "" ) |
|
inline |
◆ ErrorCount()
| size_t icarus::ValidationResult::ErrorCount |
( |
| ) |
const |
|
inlinenodiscard |
◆ GetErrors()
| std::vector< std::string > icarus::ValidationResult::GetErrors |
( |
| ) |
const |
|
inlinenodiscard |
◆ GetInfos()
| std::vector< std::string > icarus::ValidationResult::GetInfos |
( |
| ) |
const |
|
inlinenodiscard |
◆ GetIssues()
| const std::vector< ValidationIssue > & icarus::ValidationResult::GetIssues |
( |
| ) |
const |
|
inlinenodiscard |
◆ GetWarnings()
| std::vector< std::string > icarus::ValidationResult::GetWarnings |
( |
| ) |
const |
|
inlinenodiscard |
Get all warning messages.
◆ HasIssues()
| bool icarus::ValidationResult::HasIssues |
( |
| ) |
const |
|
inlinenodiscard |
Check if there are any issues at all.
◆ IsValid()
| bool icarus::ValidationResult::IsValid |
( |
| ) |
const |
|
inlinenodiscard |
Check if validation passed (no errors).
◆ WarningCount()
| size_t icarus::ValidationResult::WarningCount |
( |
| ) |
const |
|
inlinenodiscard |
The documentation for this class was generated from the following file: