File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
samples/client/petstore/cpp-restsdk Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 3
3
#include "MultipartFormData.h"
4
4
#include "ModelBase.h"
5
5
6
+ #include <sstream >
7
+ #include <limits >
8
+ #include <iomanip >
9
+
10
+ template <typename T >
11
+ utility::string_t toString(const T value)
12
+ {
13
+ std::ostringstream out;
14
+ out << std::setprecision(std::numeric_limits< T> ::digits10) << std::fixed << value;
15
+ return out.str();
16
+ }
17
+
6
18
{ {#apiNamespaceDeclarations} }
7
19
namespace { {this} } {
8
20
{{/apiNamespaceDeclarations} }
@@ -46,12 +58,12 @@ utility::string_t ApiClient::parameterToString(int32_t value)
46
58
47
59
utility::string_t ApiClient::parameterToString(float value)
48
60
{
49
- return utility::conversions::to_string_t(std::to_string (value));
61
+ return utility::conversions::to_string_t(toString (value));
50
62
}
51
63
52
64
utility::string_t ApiClient::parameterToString(double value)
53
65
{
54
- return utility::conversions::to_string_t(std::to_string (value));
66
+ return utility::conversions::to_string_t(toString (value));
55
67
}
56
68
57
69
utility::string_t ApiClient::parameterToString(const utility::datetime &value)
Original file line number Diff line number Diff line change 13
13
#include " MultipartFormData.h"
14
14
#include " ModelBase.h"
15
15
16
+ #include < sstream>
17
+ #include < limits>
18
+ #include < iomanip>
19
+
20
+ template <typename T>
21
+ utility::string_t toString (const T value)
22
+ {
23
+ std::ostringstream out;
24
+ out << std::setprecision (std::numeric_limits<T>::digits10) << std::fixed << value;
25
+ return out.str ();
26
+ }
27
+
16
28
namespace org {
17
29
namespace openapitools {
18
30
namespace client {
@@ -57,12 +69,12 @@ utility::string_t ApiClient::parameterToString(int32_t value)
57
69
58
70
utility::string_t ApiClient::parameterToString (float value)
59
71
{
60
- return utility::conversions::to_string_t (std::to_string (value));
72
+ return utility::conversions::to_string_t (toString (value));
61
73
}
62
74
63
75
utility::string_t ApiClient::parameterToString (double value)
64
76
{
65
- return utility::conversions::to_string_t (std::to_string (value));
77
+ return utility::conversions::to_string_t (toString (value));
66
78
}
67
79
68
80
utility::string_t ApiClient::parameterToString (const utility::datetime &value)
You can’t perform that action at this time.
0 commit comments