/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2019 Danny Robson */ #pragma once #include "../expected.hpp" #include "../view.hpp" #include #include namespace cruft::parse { /// Parse a number that represents a duration. eg, "1s", "5 minutes". /// /// When there is no suffix it is assumed the quantity is in second. /// /// Note: The quantities are as defined by the standard std::chrono /// durations. This means that "1 month" will equal just under 30.5 days. /// Thus the utility is not universally useful for offsetting. expected duration (cruft::view &); }