Audacity 3.2.0
PluginInterface.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file PluginInterface.cpp
6
7**********************************************************************/
8#include "PluginInterface.h"
9#include <algorithm>
10
12
13namespace {
14std::vector<long> Split(const PluginRegistryVersion &regver)
15{
16 std::vector<long> result;
17 auto strings = wxSplit(regver, '.');
18 std::transform(strings.begin(), strings.end(), std::back_inserter(result),
19 [](const wxString &string) {
20 long value;
21 string.ToLong(&value);
22 return value;
23 });
24 return result;
25}
26}
27
29 const PluginRegistryVersion &regver1, const PluginRegistryVersion &regver2)
30{
31 auto numbers1 = Split(regver1)
32 , numbers2 = Split(regver2);
33 return std::equal(
34 regver1.begin(), regver1.end(), regver2.begin(), regver2.end());
35}
36
38 const PluginRegistryVersion &regver1, const PluginRegistryVersion &regver2)
39{
40 auto numbers1 = Split(regver1)
41 , numbers2 = Split(regver2);
42 return std::lexicographical_compare(
43 regver1.begin(), regver1.end(), regver2.begin(), regver2.end());
44}
bool Regver_eq(const PluginRegistryVersion &regver1, const PluginRegistryVersion &regver2)
bool Regver_lt(const PluginRegistryVersion &regver1, const PluginRegistryVersion &regver2)
wxString PluginRegistryVersion
Type of plugin registry version information.
virtual ~PluginManagerInterface()
std::vector< long > Split(const PluginRegistryVersion &regver)