Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cameo
cameo
Commits
40b7c934
Commit
40b7c934
authored
Dec 07, 2020
by
legoc
Browse files
Implemented Instance::getResult() with optional string result
parent
671cc56e
Changes
3
Hide whitespace changes
Inline
Side-by-side
cameo-api-cpp/ChangeLog
View file @
40b7c934
...
...
@@ -4,6 +4,7 @@
* Removed Option enum and defined OUTPUSTREAM as const int.
* Added Instance::waitFor() and Instance::waitFor(int) for python binding.
* Implemented subscriber and requester with optional string result in receive() function.
* Implemented Instance::getResult() with optional string result.
1.0.2
-----
...
...
cameo-api-cpp/include/Application.h
View file @
40b7c934
...
...
@@ -291,8 +291,8 @@ public:
*/
int
getExitCode
()
const
;
bool
getBinaryResult
(
std
::
string
&
r
esult
);
bool
getResult
(
std
::
string
&
r
esult
);
std
::
optional
<
std
::
string
>
getBinaryR
esult
(
);
std
::
optional
<
std
::
string
>
getR
esult
(
);
std
::
shared_ptr
<
OutputStreamSocket
>
getOutputStreamSocket
();
...
...
cameo-api-cpp/src/Application.cpp
View file @
40b7c934
...
...
@@ -748,21 +748,19 @@ int Instance::getExitCode() const {
return
m_exitCode
;
}
bool
Instance
::
getBinaryResult
(
std
::
string
&
result
)
{
std
::
optional
<
std
::
string
>
Instance
::
getBinaryResult
()
{
waitFor
();
result
=
m_resultData
;
return
m_hasResult
;
}
bool
Instance
::
getResult
(
std
::
string
&
result
)
{
if
(
m_hasResult
)
{
return
m_resultData
;
}
string
bytes
;
getBinaryResult
(
bytes
);
parse
(
bytes
,
result
);
return
{};
}
return
m_hasResult
;
std
::
optional
<
std
::
string
>
Instance
::
getResult
()
{
return
getBinaryResult
();
}
std
::
shared_ptr
<
OutputStreamSocket
>
Instance
::
getOutputStreamSocket
()
{
...
...
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