Revert previous commit, was incorrect
[amarok.git] / src / metadata / tfile_helper.cpp
blob3162b94d161834a9a2dd7825d4c9d2f346c6ac55
1 /***************************************************************************
2 copyright : (C) 2007 by Shane King
3 email : kde@dontletsstart.com
4 ***************************************************************************/
6 /***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1, or (at your option) any later version, as published by the Free *
10 * Software Foundation. *
11 * *
12 * This library is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15 * Lesser General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with this library; if not, write to the Free Software *
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
20 * MA 02110-1301 USA *
21 ***************************************************************************/
23 #include "tfile_helper.h"
25 #include <string.h>
26 #include <strings.h>
27 #include <wchar.h>
29 bool CheckExtensionImpl(const char *fileName, const char *extension)
31 const char *ext = strrchr(fileName, '.');
32 return ext && !strcasecmp(ext, extension);
35 bool CheckExtensionImpl(const wchar_t *fileName, const wchar_t *extension)
37 const wchar_t *ext = wcsrchr(fileName, L'.');
38 return ext && !wcscasecmp(ext, extension);