NSString+SupportedMedia.m 733 B

12345678910111213141516171819202122232425262728
  1. //
  2. // NSString+SupportedMedia.m
  3. // VLC for iOS
  4. //
  5. // Created by Gleb on 6/1/13.
  6. // Copyright (c) 2013 VideoLAN. All rights reserved.
  7. //
  8. // Refer to the COPYING file of the official project for license.
  9. //
  10. #import "NSString+SupportedMedia.h"
  11. @implementation NSString (SupportedMedia)
  12. - (BOOL)isSupportedMediaFormat
  13. {
  14. NSUInteger options = NSRegularExpressionSearch | NSCaseInsensitiveSearch;
  15. return ([self rangeOfString:kSupportedFileExtensions options:options].location != NSNotFound);
  16. }
  17. - (BOOL)isSupportedSubtitleFormat
  18. {
  19. NSUInteger options = NSRegularExpressionSearch | NSCaseInsensitiveSearch;
  20. return ([self rangeOfString:kSupportedSubtitleFileExtensions options:options].location != NSNotFound);
  21. }
  22. @end