Class Result¶
Defined in File result.hpp
Class Documentation¶
-
class Result¶
Public Functions
-
Result(const std::vector<Message> &errs = std::vector<Message>(), const std::vector<Message> &warns = std::vector<Message>())¶
Standard ctor.
Standard ctor that expects a vector of error msgs and a vector of warning msgs.
- Parameters
errs – Vector of error messages
warns – Vector of warning messages
-
Result(none_t t, const std::vector<Message> &warns)¶
Only warnings ctor.
Only warnings ctor that takes boost::none as 1st parameter and expects a vector of warning msgs as 2nd parameter
- Parameters
t – boost::none
warns – Vector of warning messages
-
Result(const std::vector<Message> &errs, none_t t)¶
Only errors ctor.
Only errors ctor that expects a vector of error msgs as 1st parameter and takes boost::none as 2nd parameter
- Parameters
errs – Vector of warning messages
t – boost::none
-
Result(none_t t, const Message &warn)¶
Non-vector only warnings ctor.
Non-vector only warnings ctor that takes boost::none as 1st parameter and expects a warning msg as 2nd parameter
- Parameters
t – boost::none
warn – Vector of warning messages
-
Result(const Message &err, none_t t)¶
Non-vector only errors ctor.
Non-vector only errors ctor that expects an error msg as 1st parameter an takes boost::none as 2nd parameter
- Parameters
err – Vector of warning messages
t – boost::none
-
std::vector<Message> getWarnings() const¶
Returns the warnings vector.
Returns the warnings vector
- Returns
vector of warning msgs
-
std::vector<Message> getErrors() const¶
Returns the errors vector.
Returns the errors vector
- Returns
vector of error msgs
-
Result concat(const Result &result)¶
Appends the warnings & errors of given Result to this one.
Concatenates the errors and warnings vectors of the given Result object to those if this Result object and returns a reference to this object.
- Returns
reference to this Result
-
Result addError(const Message &error)¶
Adds an error message.
Adds an error message to this Result object and returns a reference to this object.
- Returns
reference to this Result
-
Result addWarning(const Message &warning)¶
Adds a warning message.
Adds a warning message to this Result object and returns a reference to this object.
- Returns
reference to this Result
-
bool ok() const¶
Returns true if no msgs added at all.
Returns true if neither errors nor warnings have been added, thus both vectors are empty. Returns false otherwise.
- Returns
bool indicating whether no msgs added at all
-
bool hasErrors() const¶
Returns true if no error msgs added at all.
Returns false if no errors have been added, thus vector is empty. Returns true otherwise.
- Returns
bool indicating whether error msgs added
-
bool hasWarnings() const¶
Returns true if no warning msgs added at all.
Returns false if no warnings have been added, thus vector is empty. Returns true otherwise.
- Returns
bool indicating whether warning msgs added
Friends
- inline friend NIXAPI friend std::ostream & operator<< (std::ostream &out, const Result &res)
Output operator.
Output operator to output all msgs in the Result to the given stream
- Returns
std::ostream& reference
-
Result(const std::vector<Message> &errs = std::vector<Message>(), const std::vector<Message> &warns = std::vector<Message>())¶