[haiku-development] Re: How to Identify a file?

  • From: Fredrik Modéen <fredrik@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 18 Oct 2007 11:52:14 +0200 (CEST)

> 2007/10/18, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
>> Stephan Assmus <superstippi@xxxxxx> wrote:
>> >       BFile file(&ref, B_READ_ONLY);
>>
>> A BNode node(&ref) is enough here, though.
>>
>> >       BNodeInfo nodeInfo(&file);
>> >       char mimeString[B_MIME_TYPE_LENGTH];
>> >       if (nodeInfo->GetType(mimeString) == B_OK) {
>> >               BMimeType fileType(mimeString);
>> >               BMimeType superType;
>> >               if (fileType->GetSupertype(&superType) == B_OK) {
>> >                       if (superType == "audio" || superType ==
>> "video")
>> >                               AppendToPlaylistRecursive(ref,
>> playlist);
>> >               }
>> >       }
>>
>> And since these are all no pointer, you would of course use "." not "->
>> " to reference their methods :-)
>>
>
> And make sure to traverse the entry ref to support dropped links.
thanks will look at this one.

>
> Bye,
> Jérôme
>
>


-- 
MVH
Fredrik Modéen


Other related posts: