-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patherrorStatus.cpp
More file actions
74 lines (65 loc) · 2.26 KB
/
errorStatus.cpp
File metadata and controls
74 lines (65 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project
#include "copentimelineio/errorStatus.h"
#include <opentimelineio/errorStatus.h>
#include <string.h>
OTIO_API OTIOErrorStatus*
OTIOErrorStatus_create()
{
return reinterpret_cast<OTIOErrorStatus*>(new OTIO_NS::ErrorStatus());
}
OTIO_API OTIOErrorStatus*
OTIOErrorStatus_create_with_outcome(OTIO_ErrorStatus_Outcome in_outcome)
{
return reinterpret_cast<OTIOErrorStatus*>(new OTIO_NS::ErrorStatus(
static_cast<OTIO_NS::ErrorStatus::Outcome>(in_outcome)));
}
OTIO_API OTIOErrorStatus*
OTIOErrorStatus_create_with_outcome_details_serializable_object(
OTIO_ErrorStatus_Outcome in_outcome,
const char* in_details,
OTIOSerializableObject* object)
{
return reinterpret_cast<OTIOErrorStatus*>(new OTIO_NS::ErrorStatus(
static_cast<OTIO_NS::ErrorStatus::Outcome>(in_outcome),
in_details,
reinterpret_cast<OTIO_NS::SerializableObject*>(object)));
}
OTIO_API const char*
OTIOErrorStatus_outcome_to_string(OTIO_ErrorStatus_Outcome var1)
{
std::string returnStr = OTIO_NS::ErrorStatus::outcome_to_string(
static_cast<OTIO_NS::ErrorStatus::Outcome>(var1));
char* charPtr = (char*) malloc((returnStr.size() + 1) * sizeof(char));
strcpy(charPtr, returnStr.c_str());
return charPtr;
}
OTIO_API OTIO_ErrorStatus_Outcome
OTIOErrorStatus_get_outcome(OTIOErrorStatus* self)
{
return static_cast<OTIO_ErrorStatus_Outcome>(
reinterpret_cast<OTIO_NS::ErrorStatus*>(self)->outcome);
}
OTIO_API void
OTIOErrorStatus_destroy(OTIOErrorStatus* self)
{
delete reinterpret_cast<OTIO_NS::ErrorStatus*>(self);
}
OTIO_API const char*
OTIOErrorStatus_details(OTIOErrorStatus* self)
{;
std::string returnStr =
reinterpret_cast<OTIO_NS::ErrorStatus*>(self)->details;
char *charPtr = (char *) malloc((returnStr.size() + 1) * sizeof(char));
strcpy(charPtr, returnStr.c_str());
return charPtr;
}
OTIO_API const char*
OTIOErrorStatus_full_description(OTIOErrorStatus* self)
{;
std::string returnStr =
reinterpret_cast<OTIO_NS::ErrorStatus*>(self)->full_description;
char *charPtr = (char *) malloc((returnStr.size() + 1) * sizeof(char));
strcpy(charPtr, returnStr.c_str());
return charPtr;
}