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 
17 namespace orcus {
18 
19 class pstring;
20 
21 struct ORCUS_DLLPUBLIC length_t
22 {
23  length_unit_t unit;
24  double value;
25 
26  length_t();
27 
28  std::string print() const;
29 };
30 
31 ORCUS_DLLPUBLIC double to_double(const char* p, const char* p_end, const char** p_parse_ended = NULL);
32 ORCUS_DLLPUBLIC double to_double(const pstring& s);
33 ORCUS_DLLPUBLIC long to_long(const char* p, const char* p_end, const char** p_parse_ended = NULL);
34 ORCUS_DLLPUBLIC long to_long(const pstring& s);
35 ORCUS_DLLPUBLIC bool to_bool(const pstring& s);
36 
48 ORCUS_DLLPUBLIC length_t to_length(const pstring& str);
49 
50 ORCUS_DLLPUBLIC double convert(double value, length_unit_t unit_from, length_unit_t unit_to);
51 
52 }
53 
54 #endif
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: pstring.hpp:24
Definition: measurement.hpp:21
Definition: base64.hpp:15