https://github.com/soundux/pantomime
🗃️ A C++ library for work with mime-types
https://github.com/soundux/pantomime
cpp cpp-library cpp17 cpp17-library mime mime-database mime-type mime-types mimetypes
Last synced: 7 months ago
JSON representation
🗃️ A C++ library for work with mime-types
- Host: GitHub
- URL: https://github.com/soundux/pantomime
- Owner: Soundux
- License: mit
- Created: 2022-10-05T18:35:04.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-03T08:40:14.000Z (almost 3 years ago)
- Last Synced: 2024-11-12T22:13:16.589Z (over 1 year ago)
- Topics: cpp, cpp-library, cpp17, cpp17-library, mime, mime-database, mime-type, mime-types, mimetypes
- Language: C++
- Homepage:
- Size: 797 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 📋 About
_Pantomime_ is a simple to use, zero-dependency, straight-forward, C++17 library for work with mime-types.
### 📦 Installation
- With FetchContent
```cmake
include(FetchContent)
FetchContent_Declare(pantomime GIT_REPOSITORY "https://github.com/Soundux/pantomime")
FetchContent_MakeAvailable(pantomime)
target_link_libraries( soundux::pantomime)
```
- As Git-Submodule
```bash
$ git submodule add https://github.com/Soundux/pantomime
```
```cmake
add_subdirectory(pantomime)
target_link_libraries( soundux::pantomime)
```
### 🚀 Simple Example
```cpp
auto mime = pantomime::mime::from("test.mp4").value(); // or pantomime::mime::get("video/mp4");
assert(mime.type == "video");
assert(mime.sub_type == "mp4");
assert(mime.extensions.count("mp4"));
assert(mime.compressible.value() == false);
```
---
> _Pantomime_ is based on [mime-db](https://github.com/jshttp/mime-db)
> Our logo was generated by [DALL-E](https://openai.com/dall-e-2/)