Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
5c511f3e
Commit
5c511f3e
authored
Feb 25, 2021
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svalue<double> loading as int format fixed
parent
6a8faff0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
json_functions.h
json/json_functions.h
+7
-2
No files found.
json/json_functions.h
View file @
5c511f3e
...
@@ -811,6 +811,7 @@ static void loadStrJson(const std::string& data, rapidjson::Document& document)
...
@@ -811,6 +811,7 @@ static void loadStrJson(const std::string& data, rapidjson::Document& document)
throw
Exp
()
<<
"json parse error "
<<
", code: "
<<
ok
.
Code
()
<<
", offset: "
<<
ok
.
Offset
()
<<
" at "
<<
__FILE__
<<
":"
<<
__LINE__
;
throw
Exp
()
<<
"json parse error "
<<
", code: "
<<
ok
.
Code
()
<<
", offset: "
<<
ok
.
Offset
()
<<
" at "
<<
__FILE__
<<
":"
<<
__LINE__
;
}
}
}
}
static
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
&
key
,
svalue
<
double
>&
value
,
const
bool
exist
=
true
)
static
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
&
key
,
svalue
<
double
>&
value
,
const
bool
exist
=
true
)
{
{
jsonval
::
ConstMemberIterator
itr
;
jsonval
::
ConstMemberIterator
itr
;
...
@@ -824,9 +825,13 @@ static bool loadjson(const jsonval& parent, const std::string& key, svalue<doubl
...
@@ -824,9 +825,13 @@ static bool loadjson(const jsonval& parent, const std::string& key, svalue<doubl
if
(
a
.
IsDouble
())
{
if
(
a
.
IsDouble
())
{
value
=
a
.
GetDouble
();
value
=
a
.
GetDouble
();
}
else
if
(
a
.
IsString
())
{
}
else
if
(
a
.
IsInt
())
{
value
=
static_cast
<
double
>
(
a
.
GetInt
());
}
else
if
(
a
.
IsString
())
{
std
::
string
str
=
a
.
GetString
();
const
std
::
string
str
=
a
.
GetString
();
if
(
str
.
empty
()
&&
!
exist
)
{
if
(
str
.
empty
()
&&
!
exist
)
{
if
(
loaded
)
{
if
(
loaded
)
{
*
loaded
=
false
;
*
loaded
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment