Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramin Yaghoubzadeh Torky
ipaaca
Commits
04028cfb
Commit
04028cfb
authored
6 years ago
by
Teena Chakkalayil Hassan
Browse files
Options
Downloads
Patches
Plain Diff
Added conversion of JSON number format to int.
parent
0abe5e4f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ipaacalib/cpp/include/ipaaca/ipaaca-payload.h
+8
-0
8 additions, 0 deletions
ipaacalib/cpp/include/ipaaca/ipaaca-payload.h
ipaacalib/cpp/src/ipaaca-payload.cc
+12
-0
12 additions, 0 deletions
ipaacalib/cpp/src/ipaaca-payload.cc
with
20 additions
and
0 deletions
ipaacalib/cpp/include/ipaaca/ipaaca-payload.h
+
8
−
0
View file @
04028cfb
...
...
@@ -429,6 +429,8 @@ class PayloadEntryProxy//{{{
/// Conversion to std::string (explicit or implicit)
IPAACA_HEADER_EXPORT
operator
std
::
string
();
/// Conversion to int (explicit or implicit)
IPAACA_HEADER_EXPORT
operator
int
();
/// Conversion to long (explicit or implicit)
IPAACA_HEADER_EXPORT
operator
long
();
/// Conversion to double (explicit or implicit)
...
...
@@ -468,12 +470,18 @@ class PayloadEntryProxy//{{{
IPAACA_HEADER_EXPORT
std
::
string
to_str
();
//long to_int() { return operator long(); ;
/// [DECPRECATED] use normal type conversion syntax instead
[[
deprecated
(
"Use operator int() instead (i.e. explicit or implicit cast)"
)]]
IPAACA_HEADER_EXPORT
int
to_int
();
/// [DECPRECATED] use normal type conversion syntax instead
[[
deprecated
(
"Use operator long() instead (i.e. explicit or implicit cast)"
)]]
IPAACA_HEADER_EXPORT
long
to_long
();
/// [DECPRECATED] use normal type conversion syntax instead
[[
deprecated
(
"Use operator double() instead (i.e. explicit or implicit cast)"
)]]
IPAACA_HEADER_EXPORT
double
to_float
();
/// [DECPRECATED] use normal type conversion syntax instead
[[
deprecated
(
"Use operator double() instead (i.e. explicit or implicit cast)"
)]]
IPAACA_HEADER_EXPORT
double
to_double
();
/// [DECPRECATED] use normal type conversion syntax instead
[[
deprecated
(
"Use operator bool() instead (i.e. explicit or implicit cast)"
)]]
IPAACA_HEADER_EXPORT
bool
to_bool
();
/// Append a supported type to a list-type payload value
...
...
This diff is collapsed.
Click to expand it.
ipaacalib/cpp/src/ipaaca-payload.cc
+
12
−
0
View file @
04028cfb
...
...
@@ -364,6 +364,10 @@ IPAACA_EXPORT PayloadEntryProxy::operator std::string()
{
return
json_value_cast
<
std
::
string
>
(
json_value
);
}
IPAACA_EXPORT
PayloadEntryProxy
::
operator
int
()
{
return
json_value_cast
<
int
>
(
json_value
);
}
IPAACA_EXPORT
PayloadEntryProxy
::
operator
long
()
{
return
json_value_cast
<
long
>
(
json_value
);
...
...
@@ -380,6 +384,10 @@ IPAACA_EXPORT std::string PayloadEntryProxy::to_str()
{
return
json_value_cast
<
std
::
string
>
(
json_value
);
}
IPAACA_EXPORT
int
PayloadEntryProxy
::
to_int
()
{
return
json_value_cast
<
int
>
(
json_value
);
}
IPAACA_EXPORT
long
PayloadEntryProxy
::
to_long
()
{
return
json_value_cast
<
long
>
(
json_value
);
...
...
@@ -388,6 +396,10 @@ IPAACA_EXPORT double PayloadEntryProxy::to_float()
{
return
json_value_cast
<
double
>
(
json_value
);
}
IPAACA_EXPORT
double
PayloadEntryProxy
::
to_double
()
{
return
json_value_cast
<
double
>
(
json_value
);
}
IPAACA_EXPORT
bool
PayloadEntryProxy
::
to_bool
()
{
return
json_value_cast
<
bool
>
(
json_value
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment