fs/Glob: remove redundant #ifdefs
This commit is contained in:
parent
a169a05e41
commit
48cc4a6ced
|
@ -24,34 +24,30 @@
|
||||||
|
|
||||||
#ifdef HAVE_FNMATCH
|
#ifdef HAVE_FNMATCH
|
||||||
#define HAVE_CLASS_GLOB
|
#define HAVE_CLASS_GLOB
|
||||||
#include <string>
|
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#define HAVE_CLASS_GLOB
|
#define HAVE_CLASS_GLOB
|
||||||
#include <string>
|
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CLASS_GLOB
|
#ifdef HAVE_CLASS_GLOB
|
||||||
#include "util/Compiler.h"
|
#include "util/Compiler.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pattern that matches file names. It may contain shell wildcards
|
* A pattern that matches file names. It may contain shell wildcards
|
||||||
* (asterisk and question mark).
|
* (asterisk and question mark).
|
||||||
*/
|
*/
|
||||||
class Glob {
|
class Glob {
|
||||||
#if defined(HAVE_FNMATCH) || defined(_WIN32)
|
|
||||||
std::string pattern;
|
std::string pattern;
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#if defined(HAVE_FNMATCH) || defined(_WIN32)
|
|
||||||
explicit Glob(const char *_pattern)
|
explicit Glob(const char *_pattern)
|
||||||
:pattern(_pattern) {}
|
:pattern(_pattern) {}
|
||||||
|
|
||||||
Glob(Glob &&other)
|
Glob(Glob &&other)
|
||||||
:pattern(std::move(other.pattern)) {}
|
:pattern(std::move(other.pattern)) {}
|
||||||
#endif
|
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
bool Check(const char *name_fs) const noexcept {
|
bool Check(const char *name_fs) const noexcept {
|
||||||
|
|
Loading…
Reference in New Issue