#1024. Support for C++11 #include <regex>. --grep keys may have an optional trailer /i to indicate to ignore case.

This commit is contained in:
Robin Mills
2015-12-08 09:27:38 +00:00
parent 8369445c6f
commit ab9ee2c6df
8 changed files with 129 additions and 60 deletions
+18 -4
View File
@@ -37,11 +37,25 @@
// + standard includes
#include <string>
#include <vector>
#if EXV_HAVE_REGEX
#include <regex.h>
typedef std::vector<regex_t> exv_grep_keys_t ;
#define CPLUSPLUS11 201103L
#if __cplusplus >= CPLUSPLUS11
# include <regex>
typedef std::vector<std::regex> exv_grep_keys_t ;
#else
typedef std::vector<std::string> exv_grep_keys_t ;
# if EXV_HAVE_REGEX
# include <regex.h>
typedef std::vector<regex_t> exv_grep_keys_t ;
# else
struct Exiv2_grep_key_t {
Exiv2_grep_key_t(std::string pattern,bool bIgnoreCase)
:pattern_(pattern),bIgnoreCase_(bIgnoreCase) {}
std::string pattern_;
bool bIgnoreCase_;
};
typedef std::vector<Exiv2_grep_key_t> exv_grep_keys_t ;
# endif
#endif
/*!