Add a plugin type tag and conversion functions

This commit is contained in:
Robbert van der Helm
2020-11-30 21:51:28 +01:00
parent 47baef3107
commit 67388dc2a6
2 changed files with 38 additions and 2 deletions
+17 -1
View File
@@ -29,6 +29,19 @@
*/
enum class LibArchitecture { dll_32, dll_64 };
/**
* A tag to differentiate between different plugin types.
* `plugin_tyep_to_string()` and `plugin_type_from_string()` can be used to
* convert these values to and from strings. The string form is used as a
* command line argument for the individual Wine host applications, and the enum
* form is passed directly in `GroupRequest`.
*
* The `unkonwn` tag is not used directly, but in the event that we do call
* `plugin_type_from_string()` with some invalid value we can use it to
* gracefully show an error message without resorting to exceptions.
*/
enum class PluginType { vst2, vst3, unknown };
/**
* Determine the architecture of a `.dll` file based on the file header.
*
@@ -40,4 +53,7 @@ enum class LibArchitecture { dll_32, dll_64 };
* @return The detected architecture.
* @throw std::runtime_error If the file is not a .dll file.
*/
LibArchitecture find_dll_architecture(boost::filesystem::path);
LibArchitecture find_dll_architecture(const boost::filesystem::path&);
PluginType plugin_type_from_string(const std::string& plugin_type);
std::string plugin_type_to_string(const PluginType& plugin_type);