C API: ragephoto_setphotodata(c) returns now bool

This commit is contained in:
Syping 2023-02-08 19:59:56 +01:00
parent 45a45701f6
commit 255c1a28b9
3 changed files with 8 additions and 8 deletions

View file

@ -1249,16 +1249,16 @@ void ragephoto_setbufferoffsets(ragephoto_t instance)
ragePhoto->setBufferOffsets(); ragePhoto->setBufferOffsets();
} }
void ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData) ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData)
{ {
RagePhoto *ragePhoto = static_cast<RagePhoto*>(*instance); RagePhoto *ragePhoto = static_cast<RagePhoto*>(*instance);
ragePhoto->setData(ragePhotoData, true); return ragePhoto->setData(ragePhotoData, true);
} }
void ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData) ragephoto_bool_t ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData)
{ {
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance); RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
ragePhoto->setData(ragePhotoData, false); return ragePhoto->setData(ragePhotoData, false);
} }
void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize) void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize)

View file

@ -229,9 +229,9 @@ public:
/** Sets the internal RagePhotoData object. */ /** Sets the internal RagePhotoData object. */
bool setData(RagePhotoData *ragePhotoData, bool takeOwnership = true) { bool setData(RagePhotoData *ragePhotoData, bool takeOwnership = true) {
if (takeOwnership) if (takeOwnership)
ragephoto_setphotodata(&instance, ragePhotoData); return ragephoto_setphotodata(&instance, ragePhotoData);
else else
ragephoto_setphotodatac(instance, ragePhotoData); return ragephoto_setphotodatac(instance, ragePhotoData);
} }
/** Sets the Photo description. */ /** Sets the Photo description. */
void setDescription(const char *description, uint32_t bufferSize = 0) { void setDescription(const char *description, uint32_t bufferSize = 0) {

View file

@ -167,13 +167,13 @@ LIBRAGEPHOTO_C_BINDING void ragephoto_setbufferoffsets(ragephoto_t instance);
* \param instance \p ragephoto_t instance * \param instance \p ragephoto_t instance
* \param ragePhotoData RagePhotoData object being set * \param ragePhotoData RagePhotoData object being set
*/ */
LIBRAGEPHOTO_C_BINDING void ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData); LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData);
/** Copies RagePhotoData object to internal RagePhotoData object. /** Copies RagePhotoData object to internal RagePhotoData object.
* \param instance \p ragephoto_t instance * \param instance \p ragephoto_t instance
* \param ragePhotoData RagePhotoData object being copied * \param ragePhotoData RagePhotoData object being copied
*/ */
LIBRAGEPHOTO_C_BINDING void ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData); LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData);
/** Sets the Photo description. /** Sets the Photo description.
* \param instance \p ragephoto_t instance * \param instance \p ragephoto_t instance