Skip to content

Commit

Permalink
opentime errorStatus: add get_outcome() and remove unused self param …
Browse files Browse the repository at this point in the history
…from outcome_to_string (#62)

Signed-off-by: Jon Morley <[email protected]>
  • Loading branch information
rogergodspeed authored May 3, 2024
1 parent e8a695a commit c7058a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/copentime/errorStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ OTIO_API OpenTimeErrorStatus* OpenTimeErrorStatus_create_with_outcome(
OTIO_API OpenTimeErrorStatus* OpenTimeErrorStatus_create_with_outcome_and_details(
OpenTime_ErrorStatus_Outcome in_outcome, const char* in_details);
OTIO_API const char* OpenTimeErrorStatus_outcome_to_string(
OpenTimeErrorStatus* self, OpenTime_ErrorStatus_Outcome var1);
OpenTime_ErrorStatus_Outcome var1);
OTIO_API OpenTime_ErrorStatus_Outcome OpenTimeErrorStatus_get_outcome(
OpenTimeErrorStatus* self);
OTIO_API void OpenTimeErrorStatus_destroy(OpenTimeErrorStatus* self);
8 changes: 7 additions & 1 deletion src/copentime/errorStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ OTIO_API OpenTimeErrorStatus *OpenTimeErrorStatus_create_with_outcome_and_detail
in_details));
}
OTIO_API const char *OpenTimeErrorStatus_outcome_to_string(
OpenTimeErrorStatus *self, OpenTime_ErrorStatus_Outcome var1) {
OpenTime_ErrorStatus_Outcome var1) {
std::string returnStr = opentime::ErrorStatus::outcome_to_string(
static_cast<opentime::ErrorStatus::Outcome>(var1));
return strdup(returnStr.c_str());
}
OTIO_API OpenTime_ErrorStatus_Outcome
OpenTimeErrorStatus_get_outcome(OpenTimeErrorStatus* self)
{
return static_cast<OpenTime_ErrorStatus_Outcome>(
reinterpret_cast<opentime::ErrorStatus*>(self)->outcome);
}
OTIO_API void OpenTimeErrorStatus_destroy(OpenTimeErrorStatus *self) {
delete reinterpret_cast<opentime::ErrorStatus *>(self);
}

0 comments on commit c7058a9

Please sign in to comment.