FileTypeUtils.cpp 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "EditorDefs.h"
  9. #include "FileTypeUtils.h"
  10. // the supported file types
  11. static const char* szSupportedExt[] =
  12. {
  13. "chr",
  14. "chr(c)",
  15. "skin",
  16. "skin(c)",
  17. "cdf",
  18. "cdf(c)",
  19. "cgf",
  20. "cgf(c)",
  21. "cga",
  22. "cga(c)",
  23. "cid",
  24. "caf"
  25. };
  26. bool IsPreviewableFileType (const char* szPath)
  27. {
  28. QString szExt = Path::GetExt(szPath);
  29. for (unsigned int i = 0; i < sizeof(szSupportedExt) / sizeof(szSupportedExt[0]); ++i)
  30. {
  31. if (QString::compare(szExt, szSupportedExt[i], Qt::CaseInsensitive) == 0)
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }