Orcus
Loading...
Searching...
No Matches
measurement.hpp
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 */
7
8#ifndef ORCUS_MEASUREMENT_HPP
9#define ORCUS_MEASUREMENT_HPP
10
11#include "types.hpp"
12#include "env.hpp"
13
14#include <cstdlib>
15#include <string>
16#include <optional>
17
18namespace orcus {
19
20ORCUS_DLLPUBLIC double to_double(std::string_view s, const char** p_parse_ended = nullptr);
21ORCUS_DLLPUBLIC std::optional<double> to_double_checked(std::string_view s);
22ORCUS_DLLPUBLIC long to_long(std::string_view s, const char** p_parse_ended = nullptr);
23ORCUS_DLLPUBLIC std::optional<long> to_long_checked(std::string_view s);
24ORCUS_DLLPUBLIC bool to_bool(std::string_view s);
25
37ORCUS_DLLPUBLIC length_t to_length(std::string_view str);
38
39ORCUS_DLLPUBLIC double convert(double value, length_unit_t unit_from, length_unit_t unit_to);
40
41}
42
43#endif
44/* vim:set shiftwidth=4 softtabstop=4 expandtab: */