diff --git a/bindings/c/tag_c.cpp b/bindings/c/tag_c.cpp index abe5d615..43c4a62f 100644 --- a/bindings/c/tag_c.cpp +++ b/bindings/c/tag_c.cpp @@ -90,6 +90,11 @@ void taglib_file_free(TagLib_File *file) delete reinterpret_cast(file); } +BOOL taglib_file_is_valid(const TagLib_File *file) +{ + return reinterpret_cast(file)->isValid(); +} + TagLib_Tag *taglib_file_tag(const TagLib_File *file) { const File *f = reinterpret_cast(file); diff --git a/bindings/c/tag_c.h b/bindings/c/tag_c.h index 51ac192e..d70629ec 100644 --- a/bindings/c/tag_c.h +++ b/bindings/c/tag_c.h @@ -112,6 +112,13 @@ TAGLIB_C_EXPORT TagLib_File *taglib_file_new_type(const char *filename, TagLib_F */ TAGLIB_C_EXPORT void taglib_file_free(TagLib_File *file); +/*! + * Returns true if the file is open and readble and valid information for + * the Tag and / or AudioProperties was found. + */ + +TAGLIB_C_EXPORT BOOL taglib_file_is_valid(const TagLib_File *file); + /*! * Returns a pointer to the tag associated with this file. This will be freed * automatically when the file is freed.