Descriptor of a file.
More...
#include <src/gui/backend/io/file_descriptor.h>
|
|
| FileDescriptor (const fs::path &abs_path) |
| bool | is_audio () const |
| bool | is_midi () const |
| bool | is_supported () const |
| auto | get_label () const |
|
bool | should_autoplay () const |
| | Returns whether the given file should auto-play (shorter than 1 min).
|
|
utils::Utf8String | get_icon_name () const |
| | Gets the corresponding icon name for the given FileDescriptor's type.
|
|
utils::Utf8String | get_info_text_for_label () const |
| | Returns a pango markup to be used in GTK labels.
|
|
| static std::unique_ptr< FileDescriptor > | new_from_uri (const utils::Utf8String &uri) |
| | Creates a new FileDescriptor from a URI.
|
| static utils::Utf8String | get_type_description (FileType type) |
| | Returns a human readable description of the given file type.
|
|
static bool | is_type_supported (FileType type) |
| | Returns if the given type is supported.
|
|
static bool | is_type_audio (FileType type) |
| | Returns if the FileDescriptor is an audio file.
|
|
static bool | is_type_midi (FileType type) |
| | Returns if the FileDescriptor is a midi file.
|
|
static std::optional< utils::Utf8String > | get_type_ext (FileType type) |
| | Returns the most common extension for the given filetype.
|
|
static FileType | get_type_from_path (const fs::path &file) |
| | Returns the file type of the given file path.
|
Descriptor of a file.
Definition at line 39 of file file_descriptor.h.
◆ get_label()
| auto FileDescriptor::get_label |
( |
| ) |
const |
|
inline |
◆ get_type_description()
| utils::Utf8String FileDescriptor::get_type_description |
( |
FileType | type | ) |
|
|
static |
Returns a human readable description of the given file type.
Example: wav -> "Wave file".
◆ is_audio()
| bool FileDescriptor::is_audio |
( |
| ) |
const |
|
inline |
◆ is_midi()
| bool FileDescriptor::is_midi |
( |
| ) |
const |
|
inline |
◆ is_supported()
| bool FileDescriptor::is_supported |
( |
| ) |
const |
|
inline |
◆ new_from_uri()
| std::unique_ptr< FileDescriptor > FileDescriptor::new_from_uri |
( |
const utils::Utf8String & | uri | ) |
|
|
static |
Creates a new FileDescriptor from a URI.
- Parameters
-
- Returns
- std::unique_ptr<FileDescriptor>
- Exceptions
-
◆ abs_path_
| fs::path FileDescriptor::abs_path_ |
◆ hidden_
| bool FileDescriptor::hidden_ = false |
◆ label_
| utils::Utf8String FileDescriptor::label_ |
◆ type_
The documentation for this class was generated from the following file: