mrdocs::Expected

A container holding an error or a value.

Synopsis

Declared in <mrdocs/Support/Expected.hpp>

template<
    class T,
    class E = Error>
class Expected;

Description

Monadic result type holding either a value T or an unexpected error E.

Types

Name

Description

error_type

Type produced on failure.

rebind

Rebind to an Expected with a different value type and the same error type.

unexpected_type

Convenience alias for an Unexpected containing the error type.

value_type

Type produced on success.

Member Functions

Name

Description

Expected [constructor]

Constructors

~Expected [destructor]

Destructors

operator= [deleted]

Assignment operators

and_then

and_then overloads

emplace

emplace overloads

error

Access the stored error; precondition: !has_value().

error_or

error_or overloads

has_value

Return true when the Expected contains a value.

operator*

Dereference operators

operator‐>

Access value members through pointer syntax.

or_else

or_else overloads

swap

Swap the stored state with another Expected.

transform

transform overloads

transform_error

transform_error overloads

value

value overloads

value_or

value_or overloads

operator bool

Return true when the Expected contains a value.

Data Members

Name

Description

unex_ [variant member]

Storage for the unexpected error.

val_ [variant member]

Storage for the engaged value.

Friends

Name Description

mrdocs::swap

Swap contents with another Expected.

mrdocs::operator==

Equality operator

mrdocs::operator==

Equality operator

mrdocs::operator==

Equality operator

mrdocs::Expected

A container holding an error or a value.

Non-Member Functions

Name

Description

forEachFile

Call a function for each file in a directory.

forEachFile

Visit each file in a directory.

getSinglePageFullPath

Return the full path for single page output.

parse

Parse a string view

files::createDirectory

Create a directory.

files::getFileText

Return the contents of a file as a string.

files::getFileType

Return the file type or an error

files::makeAbsolute

Return an absolute path from a possibly relative path.

files::requireAbsolute

Return an error if pathName is not absolute.

files::requireDirectory

Return an error if the path is not a directory.

js::registerHelper

Register a JavaScript helper function

Created with MrDocs