Skip to content

ThibsG/file_typing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File typing Build Status

Simple C++ wrapper for file typing using libmagic.

Example

  Magic m;
  m.open("data/test.jpg");

  std::cout << m.mime() << std::endl;
  std::cout << m.type() << std::endl;
  std::cout << m.format() << std::endl;

  // or with a buffer (loaded data stored as a std::vector<unsigned char>)

  m.load(myBuffer);

  std::cout << m.mime() << std::endl;
  std::cout << m.type() << std::endl;
  std::cout << m.format() << std::endl;

Output

image/jpeg
image
jpeg

About

Simple C++ wrapper for file typing, using libmagic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published