/** * Convert an idcode into a name (plural). * * \param idcode: The code to convert. * \return A static string representing the name of * the code. */ const char *BKE_idcode_to_name_plural(short idcode) { IDType *idt = idtype_from_code(idcode); BLI_assert(idt); return idt ? idt->plural : NULL; }
/** * Convert an idcode into its translations' context. * * \param idcode: The code to convert. * \return A static string representing the i18n context of the code. */ const char *BKE_idcode_to_translation_context(short idcode) { IDType *idt = idtype_from_code(idcode); BLI_assert(idt); return idt ? idt->i18n_context : BLT_I18NCONTEXT_DEFAULT; }
/** * Return if the ID code is a valid ID code. * * \param idcode: The code to check. * \return Boolean, 0 when invalid. */ bool BKE_idcode_is_valid(short idcode) { return idtype_from_code(idcode) ? true : false; }
/** * Return non-zero when an ID type is linkable. * * \param idcode: The code to check. * \return Boolean, 0 when non linkable. */ bool BKE_idcode_is_linkable(short idcode) { IDType *idt = idtype_from_code(idcode); BLI_assert(idt); return idt ? ((idt->flags & IDTYPE_FLAGS_ISLINKABLE) != 0) : false; }
/** * Convert an idcode into a name. * * \param code The code to convert. * \return A static string representing the name of * the code. */ const char *BKE_idcode_to_name(int code) { IDType *idt = idtype_from_code(code); BLI_assert(idt); return idt ? idt->name : NULL; }
/** * Return if the ID code is a valid ID code. * * \param code The code to check. * \return Boolean, 0 when invalid. */ bool BKE_idcode_is_valid(int code) { return idtype_from_code(code) ? true : false; }
const char *BKE_idcode_to_name_plural(int code) { IDType *idt= idtype_from_code(code); return idt?idt->plural:NULL; }
int BKE_idcode_is_linkable(int code) { IDType *idt= idtype_from_code(code); return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0; }
int BKE_idcode_is_valid(int code) { return idtype_from_code(code)?1:0; }