From d8e6b9f4eed5a03d184eb47a30218c43084baf1f Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sat, 26 Jan 2008 20:20:40 +0000 Subject: [PATCH] Add a C accessor to isValid() BUG:153944 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@766868 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- bindings/c/tag_c.cpp | 5 +++++ bindings/c/tag_c.h | 7 +++++++ 2 files changed, 12 insertions(+) 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.