MeshLib
 
Loading...
Searching...
No Matches
MRIOFilters.h
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <string>
5#include <vector>
6
7namespace MR
8{
9
13
15{
16 IOFilter() = default;
17 IOFilter( const std::string& _name, const std::string& _ext ) :
18 name{_name}, extensions{_ext}{}
19 std::string name;
20 std::string extensions; // "*.ext" or "*.ext1;*.ext2;*.ext3"
21};
22
23using IOFilters = std::vector<IOFilter>;
24
25inline IOFilters operator | ( const IOFilters& a, const IOFilters& b )
26{
27 IOFilters copy = a;
28 for ( const auto& bElem : b )
29 {
30 if ( std::find_if( a.begin(), a.end(), [&] ( const IOFilter& aF )
31 {
32 return aF.extensions == bElem.extensions;
33 } ) == a.end() )
34 copy.push_back( bElem );
35 }
36 return copy;
37}
38
40
41}
BitSet operator|(const BitSet &a, const BitSet &b)
Definition MRMesh/MRBitSet.h:323
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
Definition MRCameraOrientationPlugin.h:7
Definition MRIOFilters.h:15
IOFilter()=default
std::string extensions
Definition MRIOFilters.h:20
IOFilter(const std::string &_name, const std::string &_ext)
Definition MRIOFilters.h:17
std::string name
Definition MRIOFilters.h:19