The Battle for Wesnoth  1.15.3+dev
decimal.hpp
Go to the documentation of this file.
1 //
2 // M A R I A D B + +
3 //
4 // Copyright The ViaDuck Project 2016 - 2018.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 
9 #ifndef _MARIADB_DECIMAL_HPP_
10 #define _MARIADB_DECIMAL_HPP_
11 
12 #include <string>
13 #include <mariadb++/types.hpp>
15 
16 namespace mariadb {
17 class decimal {
18 public:
19  explicit decimal(std::string str = "") : mStr(std::move(str)) { }
20 
21  std::string str() const {
22  return mStr;
23  }
24 
25  f32 float32() const {
26  return string_cast<f32>(mStr);
27  }
28 
29  f64 double64() const {
30  return string_cast<f64>(mStr);
31  }
32 
33 private:
35 };
36 }
37 
38 #endif
double f64
Definition: types.hpp:27
f64 double64() const
Definition: decimal.hpp:29
STL namespace.
f32 float32() const
Definition: decimal.hpp:25
float f32
Definition: types.hpp:26
T string_cast(const std::string &str)
decimal(std::string str="")
Definition: decimal.hpp:19
std::string mStr
Definition: decimal.hpp:34
std::string str() const
Definition: decimal.hpp:21