From cd0a3fad5b428ab6373143854a518877f8ae73ae Mon Sep 17 00:00:00 2001 From: "alberto.ferreira" Date: Wed, 4 Mar 2020 23:23:54 +0000 Subject: [PATCH] [swig] Review StringArray_API_extensions docstrings --- swig/StringArray_API_extensions.i | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/swig/StringArray_API_extensions.i b/swig/StringArray_API_extensions.i index 431b7c739f6c..25febedc4288 100644 --- a/swig/StringArray_API_extensions.i +++ b/swig/StringArray_API_extensions.i @@ -198,16 +198,23 @@ class StringArray delete reinterpret_cast(handle); } + /** + * Retrieve the number of strings in the StringArray. + */ int StringArrayHandle_get_num_elements(StringArrayHandle handle) { return reinterpret_cast(handle)->get_num_elements(); } - /** - * Wraps LGBM_BoosterGetEvalNamesSWIG. - * + * Wraps LGBM_BoosterGetEvalNames. + * + * In case of success a new StringArray is created and returned, + * which you're responsible for freeing, + * @see StringArrayHandle_free(). + * In case of failure such resource is automatically freed. + * * @param handle Booster handle * @param eval_counts number of evaluations * @param *strings [out] Pointer to ArrayStringHandle. @@ -240,9 +247,12 @@ class StringArray /** + * Wraps LGBM_BoosterGetFeatureNames. + * * Allocates a new StringArray. You must free it yourself if it succeeds. - * @see StringArray_delete(). - * If the underlying LGBM calls fail, memory is freed automatically. + * @see StringArrayHandle_free(). + * If the underlying LGBM calls fail, memory is freed automatically, + * otherwise you're responsible for freeing it. */ int LGBM_BoosterGetFeatureNamesSWIG(BoosterHandle handle, //int num_features,