Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify string handling #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/copentime/errorStatus.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "otiostr/otiostr.h"

#ifdef __cplusplus
# define OTIO_API extern "C"
#else
Expand Down Expand Up @@ -27,6 +29,6 @@ OTIO_API OpenTimeErrorStatus* OpenTimeErrorStatus_create_with_outcome(
OpenTime_ErrorStatus_Outcome in_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(
OTIO_API otiostr OpenTimeErrorStatus_outcome_to_string(
OpenTimeErrorStatus* self, OpenTime_ErrorStatus_Outcome var1);
OTIO_API void OpenTimeErrorStatus_destroy(OpenTimeErrorStatus* self);
7 changes: 4 additions & 3 deletions include/copentime/rationalTime.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "copentime/errorStatus.h"
#include "otiostr/otiostr.h"
#include <stdbool.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -64,16 +65,16 @@ OTIO_API int RationalTime_to_frames_with_rate(RationalTime self, double rate);

OTIO_API double RationalTime_to_seconds(RationalTime self);

OTIO_API const char *RationalTime_to_timecode(
OTIO_API otiostr RationalTime_to_timecode(
RationalTime self,
double rate,
OpenTime_IsDropFrameRate drop_frame,
OpenTimeErrorStatus *error_status);

OTIO_API const char *RationalTime_to_timecode_auto(
OTIO_API otiostr RationalTime_to_timecode_auto(
RationalTime self, OpenTimeErrorStatus *error_status);

OTIO_API const char *RationalTime_to_time_string(RationalTime self);
OTIO_API otiostr RationalTime_to_time_string(RationalTime self);

OTIO_API RationalTime RationalTime_add(RationalTime lhs, RationalTime rhs);

Expand Down
3 changes: 2 additions & 1 deletion include/copentimelineio/anyDictionary.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "any.h"
#include <stdbool.h>
#include <otiostr/otiostr.h>

#ifdef __cplusplus
# define OTIO_API extern "C"
Expand Down Expand Up @@ -37,7 +38,7 @@ OTIO_API AnyDictionaryIterator*
AnyDictionaryIterator_next(AnyDictionaryIterator* iter, int dist);
OTIO_API AnyDictionaryIterator*
AnyDictionaryIterator_prev(AnyDictionaryIterator* iter, int dist);
OTIO_API const char* AnyDictionaryIterator_key(AnyDictionaryIterator* iter);
OTIO_API otiostr AnyDictionaryIterator_key(AnyDictionaryIterator* iter);
OTIO_API Any* AnyDictionaryIterator_value(AnyDictionaryIterator* iter);
OTIO_API bool AnyDictionaryIterator_equal(
AnyDictionaryIterator* lhs, AnyDictionaryIterator* rhs);
Expand Down
6 changes: 3 additions & 3 deletions include/copentimelineio/clip.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ OTIO_API TimeRange Clip_transformed_time_range(
OTIO_API bool Clip_visible(Clip *self);
OTIO_API bool Clip_overlapping(Clip *self);
OTIO_API Composition *Clip_parent(Clip *self);
OTIO_API const char *Clip_name(Clip *self);
OTIO_API otiostr Clip_name(Clip *self);
OTIO_API AnyDictionary *Clip_metadata(Clip *self);
OTIO_API void Clip_set_name(Clip *self, const char *name);
OTIO_API bool Clip_to_json_file(
Clip *self,
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *
OTIO_API otiostr
Clip_to_json_string(Clip *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool Clip_is_equivalent_to(Clip *self, OTIOSerializableObject *other);
OTIO_API Clip *Clip_clone(Clip *self, OTIOErrorStatus *error_status);
OTIO_API const char *Clip_schema_name(Clip *self);
OTIO_API otiostr Clip_schema_name(Clip *self);
OTIO_API int Clip_schema_version(Clip *self);
6 changes: 3 additions & 3 deletions include/copentimelineio/composable.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ OTIO_API bool Composable_overlapping(Composable *self);
OTIO_API Composition *Composable_parent(Composable *self);
OTIO_API RationalTime
Composable_duration(Composable *self, OTIOErrorStatus *error_status);
OTIO_API const char *Composable_name(Composable *self);
OTIO_API otiostr Composable_name(Composable *self);
OTIO_API AnyDictionary *Composable_metadata(Composable *self);
OTIO_API void Composable_set_name(Composable *self, const char *name);
OTIO_API bool Composable_to_json_file(
Composable *self,
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *Composable_to_json_string(
OTIO_API otiostr Composable_to_json_string(
Composable *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool Composable_is_equivalent_to(Composable *self, OTIOSerializableObject *other);
OTIO_API Composable *
Composable_clone(Composable *self, OTIOErrorStatus *error_status);
OTIO_API const char *Composable_schema_name(Composable *self);
OTIO_API otiostr Composable_schema_name(Composable *self);
OTIO_API int Composable_schema_version(Composable *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/composition.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ OTIO_API Composition *Composition_create(
AnyDictionary *metadata,
EffectVector *effects,
MarkerVector *markers);
OTIO_API const char *Composition_composition_kind(Composition *self);
OTIO_API otiostr Composition_composition_kind(Composition *self);
OTIO_API ComposableRetainerVector *Composition_children(Composition *self);
OTIO_API void Composition_clear_children(Composition *self);
OTIO_API bool Composition_set_children(
Expand Down Expand Up @@ -101,19 +101,19 @@ OTIO_API TimeRange Composition_transformed_time_range(
Item *to_item,
OTIOErrorStatus *error_status);
OTIO_API Composition *Composition_parent(Composition *self);
OTIO_API const char *Composition_name(Composition *self);
OTIO_API otiostr Composition_name(Composition *self);
OTIO_API AnyDictionary *Composition_metadata(Composition *self);
OTIO_API void Composition_set_name(Composition *self, const char *name);
OTIO_API bool Composition_to_json_file(
Composition *self,
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *Composition_to_json_string(
OTIO_API otiostr Composition_to_json_string(
Composition *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool
Composition_is_equivalent_to(Composition *self, OTIOSerializableObject *other);
OTIO_API Composition *
Composition_clone(Composition *self, OTIOErrorStatus *error_status);
OTIO_API const char *Composition_schema_name(Composition *self);
OTIO_API otiostr Composition_schema_name(Composition *self);
OTIO_API int Composition_schema_version(Composition *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ OTIO_API void RetainerEffect_managed_destroy(RetainerEffect *self);
OTIO_API Effect *Effect_create(
const char *name, const char *effect_name, AnyDictionary *metadata);

OTIO_API const char *Effect_effect_name(Effect *self);
OTIO_API otiostr Effect_effect_name(Effect *self);

OTIO_API void Effect_set_effect_name(Effect *self, const char *effect_name);

OTIO_API const char *Effect_name(Effect *self);
OTIO_API otiostr Effect_name(Effect *self);

OTIO_API void Effect_set_name(Effect *self, const char *name);

Expand All @@ -39,13 +39,13 @@ OTIO_API bool Effect_to_json_file(
OTIOErrorStatus *error_status,
int indent);

OTIO_API const char *Effect_to_json_string(
OTIO_API otiostr Effect_to_json_string(
Effect *self, OTIOErrorStatus *error_status, int indent);

OTIO_API bool Effect_is_equivalent_to(Effect *self, OTIOSerializableObject *other);

OTIO_API Effect *Effect_clone(Effect *self, OTIOErrorStatus *error_status);

OTIO_API const char *Effect_schema_name(Effect *self);
OTIO_API otiostr Effect_schema_name(Effect *self);

OTIO_API int Effect_schema_version(Effect *self);
3 changes: 2 additions & 1 deletion include/copentimelineio/errorStatus.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "serializableObject.h"
#include "otiostr/otiostr.h"

#ifdef __cplusplus
# define OTIO_API extern "C"
Expand Down Expand Up @@ -48,6 +49,6 @@ OTIO_API OTIOErrorStatus* OTIOErrorStatus_create_with_outcome_details_serializab
const char* in_details,
OTIOSerializableObject* object);

OTIO_API const char* OTIOErrorStatus_outcome_to_string(OTIO_ErrorStatus_Outcome var1);
OTIO_API otiostr OTIOErrorStatus_outcome_to_string(OTIO_ErrorStatus_Outcome var1);
OTIO_API OTIO_ErrorStatus_Outcome OTIOErrorStatus_get_outcome(OTIOErrorStatus* self);
OTIO_API void OTIOErrorStatus_destroy(OTIOErrorStatus* self);
8 changes: 4 additions & 4 deletions include/copentimelineio/externalReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OTIO_API ExternalReference *ExternalReference_create(
OptionalTimeRange available_range,
AnyDictionary *metadata);

OTIO_API const char *ExternalReference_target_url(ExternalReference *self);
OTIO_API otiostr ExternalReference_target_url(ExternalReference *self);

OTIO_API void ExternalReference_set_target_url(
ExternalReference *self, const char *target_url);
Expand All @@ -31,7 +31,7 @@ OTIO_API void ExternalReference_set_available_range(

OTIO_API bool ExternalReference_is_missing_reference(ExternalReference *self);

OTIO_API const char *ExternalReference_name(ExternalReference *self);
OTIO_API otiostr ExternalReference_name(ExternalReference *self);

OTIO_API void ExternalReference_set_name(ExternalReference *self, const char *name);

Expand All @@ -43,7 +43,7 @@ OTIO_API bool ExternalReference_to_json_file(
OTIOErrorStatus *error_status,
int indent);

OTIO_API const char *ExternalReference_to_json_string(
OTIO_API otiostr ExternalReference_to_json_string(
ExternalReference *self, OTIOErrorStatus *error_status, int indent);

OTIO_API bool ExternalReference_is_equivalent_to(
Expand All @@ -52,6 +52,6 @@ OTIO_API bool ExternalReference_is_equivalent_to(
OTIO_API ExternalReference *ExternalReference_clone(
ExternalReference *self, OTIOErrorStatus *error_status);

OTIO_API const char *ExternalReference_schema_name(ExternalReference *self);
OTIO_API otiostr ExternalReference_schema_name(ExternalReference *self);

OTIO_API int ExternalReference_schema_version(ExternalReference *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/freezeFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ OTIO_API double FreezeFrame_time_scalar(FreezeFrame *self);

OTIO_API void FreezeFrame_set_time_scalar(FreezeFrame *self, double time_scalar);

OTIO_API const char *FreezeFrame_effect_name(FreezeFrame *self);
OTIO_API otiostr FreezeFrame_effect_name(FreezeFrame *self);

OTIO_API void
FreezeFrame_set_effect_name(FreezeFrame *self, const char *effect_name);

OTIO_API const char *FreezeFrame_name(FreezeFrame *self);
OTIO_API otiostr FreezeFrame_name(FreezeFrame *self);

OTIO_API void FreezeFrame_set_name(FreezeFrame *self, const char *name);

Expand All @@ -35,7 +35,7 @@ OTIO_API bool FreezeFrame_to_json_file(
OTIOErrorStatus *error_status,
int indent);

OTIO_API const char *FreezeFrame_to_json_string(
OTIO_API otiostr FreezeFrame_to_json_string(
FreezeFrame *self, OTIOErrorStatus *error_status, int indent);

OTIO_API bool
Expand All @@ -44,6 +44,6 @@ FreezeFrame_is_equivalent_to(FreezeFrame *self, OTIOSerializableObject *other);
OTIO_API FreezeFrame *
FreezeFrame_clone(FreezeFrame *self, OTIOErrorStatus *error_status);

OTIO_API const char *FreezeFrame_schema_name(FreezeFrame *self);
OTIO_API otiostr FreezeFrame_schema_name(FreezeFrame *self);

OTIO_API int FreezeFrame_schema_version(FreezeFrame *self);
6 changes: 3 additions & 3 deletions include/copentimelineio/gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ OTIO_API TimeRange Gap_transformed_time_range(

OTIO_API Composition *Gap_parent(Gap *self);

OTIO_API const char *Gap_name(Gap *self);
OTIO_API otiostr Gap_name(Gap *self);

OTIO_API AnyDictionary *Gap_metadata(Gap *self);

Expand All @@ -84,13 +84,13 @@ OTIO_API bool Gap_to_json_file(
OTIOErrorStatus *error_status,
int indent);

OTIO_API const char *
OTIO_API otiostr
Gap_to_json_string(Gap *self, OTIOErrorStatus *error_status, int indent);

OTIO_API bool Gap_is_equivalent_to(Gap *self, OTIOSerializableObject *other);

OTIO_API Gap *Gap_clone(Gap *self, OTIOErrorStatus *error_status);

OTIO_API const char *Gap_schema_name(Gap *self);
OTIO_API otiostr Gap_schema_name(Gap *self);

OTIO_API int Gap_schema_version(Gap *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/generatorReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ OTIO_API GeneratorReference *GeneratorReference_create(
OptionalTimeRange available_range,
AnyDictionary *parameters,
AnyDictionary *metadata);
OTIO_API const char *GeneratorReference_generator_kind(GeneratorReference *self);
OTIO_API otiostr GeneratorReference_generator_kind(GeneratorReference *self);
OTIO_API void GeneratorReference_set_generator_kind(
GeneratorReference *self, const char *generator_kind);
OTIO_API AnyDictionary *GeneratorReference_parameters(GeneratorReference *self);
OTIO_API OptionalTimeRange GeneratorReference_available_range(GeneratorReference *self);
OTIO_API void GeneratorReference_set_available_range(
GeneratorReference *self, OptionalTimeRange available_range);
OTIO_API bool GeneratorReference_is_missing_reference(GeneratorReference *self);
OTIO_API const char *GeneratorReference_name(GeneratorReference *self);
OTIO_API otiostr GeneratorReference_name(GeneratorReference *self);
OTIO_API void
GeneratorReference_set_name(GeneratorReference *self, const char *name);
OTIO_API AnyDictionary *GeneratorReference_metadata(GeneratorReference *self);
Expand All @@ -37,11 +37,11 @@ OTIO_API bool GeneratorReference_to_json_file(
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *GeneratorReference_to_json_string(
OTIO_API otiostr GeneratorReference_to_json_string(
GeneratorReference *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool GeneratorReference_is_equivalent_to(
GeneratorReference *self, OTIOSerializableObject *other);
OTIO_API GeneratorReference *GeneratorReference_clone(
GeneratorReference *self, OTIOErrorStatus *error_status);
OTIO_API const char *GeneratorReference_schema_name(GeneratorReference *self);
OTIO_API otiostr GeneratorReference_schema_name(GeneratorReference *self);
OTIO_API int GeneratorReference_schema_version(GeneratorReference *self);
6 changes: 3 additions & 3 deletions include/copentimelineio/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ OTIO_API TimeRange Item_transformed_time_range(
Item *to_item,
OTIOErrorStatus *error_status);
OTIO_API Composition *Item_parent(Item *self);
OTIO_API const char *Item_name(Item *self);
OTIO_API otiostr Item_name(Item *self);
OTIO_API AnyDictionary *Item_metadata(Item *self);
OTIO_API void Item_set_name(Item *self, const char *name);
OTIO_API bool Item_to_json_file(
Item *self,
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *
OTIO_API otiostr
Item_to_json_string(Item *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool Item_is_equivalent_to(Item *self, OTIOSerializableObject *other);
OTIO_API Item *Item_clone(Item *self, OTIOErrorStatus *error_status);
OTIO_API const char *Item_schema_name(Item *self);
OTIO_API otiostr Item_schema_name(Item *self);
OTIO_API int Item_schema_version(Item *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/linearTimeWarp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ OTIO_API double LinearTimeWarp_time_scalar(LinearTimeWarp *self);
OTIO_API void
LinearTimeWarp_set_time_scalar(LinearTimeWarp *self, double time_scalar);

OTIO_API const char *LinearTimeWarp_effect_name(LinearTimeWarp *self);
OTIO_API otiostr LinearTimeWarp_effect_name(LinearTimeWarp *self);

OTIO_API void LinearTimeWarp_set_effect_name(
LinearTimeWarp *self, const char *effect_name);

OTIO_API const char *LinearTimeWarp_name(LinearTimeWarp *self);
OTIO_API otiostr LinearTimeWarp_name(LinearTimeWarp *self);

OTIO_API void LinearTimeWarp_set_name(LinearTimeWarp *self, const char *name);

Expand All @@ -40,7 +40,7 @@ OTIO_API bool LinearTimeWarp_to_json_file(
OTIOErrorStatus *error_status,
int indent);

OTIO_API const char *LinearTimeWarp_to_json_string(
OTIO_API otiostr LinearTimeWarp_to_json_string(
LinearTimeWarp *self, OTIOErrorStatus *error_status, int indent);

OTIO_API bool LinearTimeWarp_is_equivalent_to(
Expand All @@ -49,6 +49,6 @@ OTIO_API bool LinearTimeWarp_is_equivalent_to(
OTIO_API LinearTimeWarp *
LinearTimeWarp_clone(LinearTimeWarp *self, OTIOErrorStatus *error_status);

OTIO_API const char *LinearTimeWarp_schema_name(LinearTimeWarp *self);
OTIO_API otiostr LinearTimeWarp_schema_name(LinearTimeWarp *self);

OTIO_API int LinearTimeWarp_schema_version(LinearTimeWarp *self);
8 changes: 4 additions & 4 deletions include/copentimelineio/marker.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ OTIO_API Marker *Marker_create(
OptionalTimeRange marked_range,
const char *color,
AnyDictionary *metadata);
OTIO_API const char *Marker_color(Marker *self);
OTIO_API otiostr Marker_color(Marker *self);
OTIO_API void Marker_set_color(Marker *self, const char *color);
OTIO_API TimeRange Marker_marked_range(Marker *self);
OTIO_API void Marker_set_marked_range(Marker *self, TimeRange marked_range);
OTIO_API const char *Marker_name(Marker *self);
OTIO_API otiostr Marker_name(Marker *self);
OTIO_API void Marker_set_name(Marker *self, const char *name);
OTIO_API AnyDictionary *Marker_metadata(Marker *self);
OTIO_API bool Marker_to_json_file(
Marker *self,
const char *file_name,
OTIOErrorStatus *error_status,
int indent);
OTIO_API const char *Marker_to_json_string(
OTIO_API otiostr Marker_to_json_string(
Marker *self, OTIOErrorStatus *error_status, int indent);
OTIO_API bool Marker_is_equivalent_to(Marker *self, OTIOSerializableObject *other);
OTIO_API Marker *Marker_clone(Marker *self, OTIOErrorStatus *error_status);
OTIO_API const char *Marker_schema_name(Marker *self);
OTIO_API otiostr Marker_schema_name(Marker *self);
OTIO_API int Marker_schema_version(Marker *self);
Loading