![]() |
OpenMS
|
Filename-only format recognition and extension manipulation. More...
#include <OpenMS/FORMAT/FileNameUtils.h>
Static Public Member Functions | |
| static FileTypes::Type | getTypeByFileName (const std::string &filename) |
| Determine a file type from its name, including compression suffixes. | |
| static bool | hasValidExtension (const std::string &filename, FileTypes::Type type) |
| Accept the expected extension or an unknown extension. | |
| static std::string | stripExtension (const std::string &filename) |
| Remove the extension using the established FileHandler rules. | |
| static std::string | swapExtension (const std::string &filename, FileTypes::Type new_type) |
| Strip the existing extension and append the requested extension. | |
Filename-only format recognition and extension manipulation.
These operations preserve FileHandler's filename rules and never inspect file contents or require the path to exist. Both slash styles are recognized on every platform. FileHandler retains its existing forwarding entry points.
|
static |
Determine a file type from its name, including compression suffixes.
| [in] | filename | Filename to inspect. |
|
static |
Accept the expected extension or an unknown extension.
| [in] | filename | Filename to inspect. |
| [in] | type | Expected type. |
|
static |
Remove the extension using the established FileHandler rules.
| [in] | filename | Filename whose extension should be removed. |
|
static |
Strip the existing extension and append the requested extension.
| [in] | filename | Original filename. |
| [in] | new_type | Type of the new extension. |