- addNewPathToFindFileFormats
void addNewPathToFindFileFormats(string dir)
The functions allows to extend paths to find JSON files with file formats.
- contentTypeGuess
auto contentTypeGuess(string filepath)
Returns tuple with MIME type and its description.
- g_content_type_get_description
char* g_content_type_get_description(char* type)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- g_content_type_get_mime_type
char* g_content_type_get_mime_type(char* type)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- getAllFileFormats
FileFormat[] getAllFileFormats()
Returns array of supported file formats.
- getFileFormat
FileFormat getFileFormat(string filepath, string additExt)
The function gets the FileFormat structure with info about file format.
- getFileFormat
FileFormat getFileFormat(string filepath)
The function gets the FileFormat structure with info about file format.
- isUnicodeTextFile
bool isUnicodeTextFile(string filepath)
The function returns true if specified file contains plain Unicode-text.
This file is part of the Amalthea library. Copyright (C) 2019-2024 Eugene 'Vindex' Stulin Distributed under the BSL 1.0 or (at your option) the GNU LGPL 3.0 or later.
The module implements recognition of file formats. Main function of this module: FileFormat getFileFormat(string filepath) Recognition is carried out according to a complex algorithm based on a special file containing information about file formats. The default path of such file for a normal library installation is: /etc/amalthea-${DC}/fileformats.json You can expand the search paths for format descriptions with: void addNewPathToFindFileFormats(string dir)