morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
route_history.hpp File Reference

Route history (spec 3 §10, spec 6 §20): the route of the screen a shell shows, kept in a history the user moves through with back and forward, such as a browser's. More...

#include <functional>
#include <memory>
#include <string>
#include <string_view>
#include <utility>

Go to the source code of this file.

Classes

class  morph::ui::IHistory
 A history of routes: a browser's session history, or a test's. More...
class  morph::ui::RouteHistory
 Keeps the route of the screen a shell shows in a history, and opens the route of an entry the user moves to (spec 3 §10). More...

Functions

std::string morph::ui::fragmentOf (std::string_view route)
 The URL fragment that holds a route.
std::string morph::ui::routeOfFragment (std::string_view fragment)
 The route a URL fragment holds.

Detailed Description

Route history (spec 3 §10, spec 6 §20): the route of the screen a shell shows, kept in a history the user moves through with back and forward, such as a browser's.

Specified in docs/spec/ui/host.md, "Route history".

Definition in file route_history.hpp.

Function Documentation

◆ fragmentOf()

std::string morph::ui::fragmentOf ( std::string_view route)
inlinenodiscard

The URL fragment that holds a route.

Parameters
routeThe route.
Returns
#/ followed by the route.

Definition at line 49 of file route_history.hpp.

◆ routeOfFragment()

std::string morph::ui::routeOfFragment ( std::string_view fragment)
inlinenodiscard

The route a URL fragment holds.

Parameters
fragmentThe fragment, with its #.
Returns
The route after #/, or empty for a fragment of any other form.

Definition at line 58 of file route_history.hpp.