All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
regex.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_ARCH_REGEX_H
8#define PXR_BASE_ARCH_REGEX_H
9
10#include "pxr/pxr.h"
11#include "pxr/base/arch/api.h"
12
13#include <memory>
14#include <string>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18class ArchRegex {
19public:
20 enum : unsigned int {
21 CASE_INSENSITIVE = 1u,
22 GLOB = 2u
23 };
24
26 ArchRegex() = default;
27
28 ArchRegex(ArchRegex &&) noexcept = default;
29 ArchRegex(ArchRegex const &) = default;
30 ArchRegex &operator=(ArchRegex &&) noexcept = default;
31 ArchRegex &operator=(ArchRegex const &) = default;
32
34 ARCH_API ArchRegex(const std::string& pattern, unsigned int flags = 0);
35
37 ARCH_API ~ArchRegex();
38
40 ARCH_API explicit operator bool() const;
41
44 ARCH_API std::string GetError() const;
45
47 ARCH_API unsigned int GetFlags() const;
48
51 ARCH_API bool Match(const std::string& query) const;
52
53private:
54 class _Impl;
55 unsigned int _flags = 0;
56 std::string _error;
57 std::shared_ptr<const _Impl> _impl;
58};
59
60PXR_NAMESPACE_CLOSE_SCOPE
61
62#endif // PXR_BASE_ARCH_REGEX_H
STL namespace.