Orcus
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
17namespace orcus {
18
19class pstring;
20
21ORCUS_DLLPUBLIC double to_double(const char* p, const char* p_end, const char** p_parse_ended = nullptr);
22ORCUS_DLLPUBLIC double to_double(const pstring& s);
23ORCUS_DLLPUBLIC long to_long(const char* p, const char* p_end, const char** p_parse_ended = nullptr);
24ORCUS_DLLPUBLIC long to_long(const pstring& s);
25ORCUS_DLLPUBLIC bool to_bool(const pstring& s);
26
38ORCUS_DLLPUBLIC length_t to_length(const pstring& str);
39
40ORCUS_DLLPUBLIC double convert(double value, length_unit_t unit_from, length_unit_t unit_to);
41
42}
43
44#endif
45/* vim:set shiftwidth=4 softtabstop=4 expandtab: */