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

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 18 Oct 2007 11:22:47 +0200 CEST

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 :-)

Bye,
   Axel.


Other related posts: