A parser result, which may contain a result of type T, or an error, or both.
More...
#include "donner/base/ParseResult.h"
template<
typename T>
class donner::ParseResult< T >
A parser result, which may contain a result of type T, or an error, or both.
- Template Parameters
-
- Examples
- svg_to_png.cc, and svg_tree_interaction.cc.
◆ ParseResult()
Return a result, but also an error.
Used in the case where partial parse results may be returned.
◆ error() [1/3]
Returns the contained error.
- Precondition
- There is a valid error, i.e. hasError() returns true.
- Examples
- svg_to_png.cc.
◆ error() [2/3]
Returns the contained error.
- Precondition
- There is a valid error, i.e. hasError() returns true.
◆ error() [3/3]
Returns the contained error.
- Precondition
- There is a valid error, i.e. hasError() returns true.
◆ map()
Map the result of this ParseResult to a new type, by transforming the result with the provided functor.
- Template Parameters
-
Target | The type to map to. |
Functor | The functor type. |
- Parameters
-
functor | The functor to apply to the result. |
◆ mapError()
Map the error of this ParseResult to a new type, by transforming the error with the provided functor.
- Template Parameters
-
Target | The type to map to. |
Functor | The functor type. |
- Parameters
-
functor | The functor to apply to the error. |
◆ result() [1/3]
Returns the contained result.
- Precondition
- There is a valid result, i.e. hasResult() returns true.
- Examples
- svg_to_png.cc.
◆ result() [2/3]
Returns the contained result.
- Precondition
- There is a valid result, i.e. hasResult() returns true.
◆ result() [3/3]
Returns the contained result.
- Precondition
- There is a valid result, i.e. hasResult() returns true.
The documentation for this class was generated from the following file: