implement remaining logic

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2024-01-03 17:14:26 +01:00 committed by Folling
parent e1bf97704a
commit 1ce811d566
No known key found for this signature in database
41 changed files with 1393 additions and 408 deletions

View file

@ -51,39 +51,13 @@ IKA_API IkarusProject * ikarus_project_create_in_memory(char const * name, Ikaru
/// ikarus_project_delete
IKA_API IkarusProject * ikarus_project_open(char const * path, IkarusErrorData * error_out);
/// \brief Copies a project to a new location.
/// \details The new project is not opened.
/// \param project The project to copy.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param target_path The new location of the project.
/// \pre \li Must not be null.
/// \pre \li Must point to a valid unused path on the system.
/// \param target_name The name of the new project.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param error_out \see errors.h
/// \remark If successful the project connection remains intact. The previous location will still exist.
IKA_API void
ikarus_project_copy(IkarusProject const * project, char const * target_path, char const * target_name, IkarusErrorData * error_out);
/// \brief Deletes a project and all its associated data from the filesystem.
/// \param project The project to delete.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \remark also frees the project.
/// \remark In-Memory projects will just be freed.
/// \remark If deletion fails, the project pointer remains intact.
IKA_API void ikarus_project_delete(IkarusProject * project, IkarusErrorData * error_out);
/// \brief Gets the name of a project.
/// \param project The project to get the name of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The name of the project.
/// \remark Must be freed using #ikarus_free.
/// \remark Ownership remains with libikarus, must not be freed.
IKA_API char const * ikarus_project_get_name(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Sets the name of a project.
@ -102,30 +76,9 @@ IKA_API void ikarus_project_set_name(IkarusProject * project, char const * new_n
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The path of the project.
/// \remark Must be freed using #ikarus_free.
/// \remark Ownership remains with libikarus, must not be freed.
IKA_API char const * ikarus_project_get_path(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Moves a project to a new location.
/// \param project The project to move.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param target_path The new location of the project.
/// \pre \li Must not be null.
/// \pre \li Must point to a valid unused path on the system.
/// \param error_out \see errors.h
/// \remark If successful the project connection remains intact. The previous location will not exist anymore.
/// \remark Due to the nature of filesystems this function may not be atomic.
IKA_API void ikarus_project_move(IkarusProject * project, char const * target_path, IkarusErrorData * error_out);
/// \brief Gets the blueprint root folder of a project.
/// \param project The project to get the blueprint root folder of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The blueprint root folder of the project or null if an error occurs.
/// \remark Must be freed using #ikarus_free.
IKA_API struct IkarusBlueprintFolder * ikarus_project_get_blueprint_root_folder(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Gets the blueprints of a project.
/// \param project The project to get the blueprints of.
/// \pre \li Must not be null.
@ -135,7 +88,7 @@ IKA_API struct IkarusBlueprintFolder * ikarus_project_get_blueprint_root_folder(
/// \param blueprints_out_size The size of the buffer.
/// \param error_out \see errors.h
IKA_API void ikarus_project_get_blueprints(
IkarusProject const * project,
IkarusProject * project,
struct IkarusBlueprint ** blueprints_out,
size_t blueprints_out_size,
IkarusErrorData * error_out
@ -147,16 +100,7 @@ IKA_API void ikarus_project_get_blueprints(
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of blueprints or undefined if an error occurs.
IKA_API size_t ikarus_project_get_blueprint_count(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Gets the entity root folder of a project.
/// \param project The project to get the entity root folder of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The entity root folder of the project or null if an error occurs.
/// \remark Must be freed using #ikarus_free.
IKA_API struct IkarusEntityFolder * ikarus_project_get_entity_root_folder(IkarusProject const * project, IkarusErrorData * error_out);
IKA_API size_t ikarus_project_get_blueprint_count(IkarusProject * project, IkarusErrorData * error_out);
/// \brief Gets the entities of a project.
/// \param project The project to get the entities of.
@ -167,7 +111,7 @@ IKA_API struct IkarusEntityFolder * ikarus_project_get_entity_root_folder(Ikarus
/// \param entities_out_size The size of the buffer.
/// \param error_out \see errors.h
IKA_API void ikarus_project_get_entities(
IkarusProject const * project,
IkarusProject * project,
struct IkarusEntity ** entities_out,
size_t entities_out_size,
IkarusErrorData * error_out
@ -179,7 +123,7 @@ IKA_API void ikarus_project_get_entities(
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of entities or undefined if an error occurs.
IKA_API size_t ikarus_project_get_entity_count(IkarusProject const * project, IkarusErrorData * error_out);
IKA_API size_t ikarus_project_get_entity_count(IkarusProject * project, IkarusErrorData * error_out);
IKARUS_END_HEADER