MeshLib Documentation
Loading...
Searching...
No Matches
MRIOFilters.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include <compare>
5#include <optional>
6#include <string>
7#include <vector>
8
9namespace MR
10{
11
15
17{
18 IOFilter() = default;
19 IOFilter( std::string _name, std::string _ext )
20 : name{ std::move( _name ) }
21 , extensions{ std::move( _ext ) }
22 {}
23
24 std::string name;
25 std::string extensions; // "*.ext" or "*.ext1;*.ext2;*.ext3"
26
27 std::partial_ordering operator <=>( const IOFilter& ) const = default;
28
29 [[nodiscard]] MRMESH_API bool isSupportedExtension( const std::string& ext ) const;
30};
31
32using IOFilters = std::vector<IOFilter>;
33
35[[nodiscard]] MRMESH_API IOFilters operator | ( const IOFilters& a, const IOFilters& b );
36
38[[nodiscard]] MRMESH_API std::optional<IOFilter> findFilter( const IOFilters& filters, const std::string& extension );
39
41
42}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
BitSet operator|(const BitSet &a, const BitSet &b)
Definition MRMesh/MRBitSet.h:340
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:32
MRMESH_API std::optional< IOFilter > findFilter(const IOFilters &filters, const std::string &extension)
find a corresponding filter for a given extension
Definition MRCameraOrientationPlugin.h:8
Definition MRIOFilters.h:17
IOFilter(std::string _name, std::string _ext)
Definition MRIOFilters.h:19
IOFilter()=default
MRMESH_API bool isSupportedExtension(const std::string &ext) const
std::partial_ordering operator<=>(const IOFilter &) const =default
std::string extensions
Definition MRIOFilters.h:25
std::string name
Definition MRIOFilters.h:24