c++ - How to distinguish between movie and image -
is there "good" way distinguish between movie file , image file? know "std::wstring filepath" - movie, or image. therefore, go further strong assurance working known file type.
in other words, have 2 classes myimage , mymovie both need path file in constructors. verify path file somehow before creating 1 of classes.
bool ismovie(const std::wstring & filepath); bool isimage(const std::wstring & filepath);
of course thought file extensions, i'm not sure , not prone errors solution. use file extension or other feasible solution possible.?
thanks in advance
you can use libmagic detect kind of file is. pass file path in , it'll give textual description or mime type file.
Comments
Post a Comment