7#ifndef PXR_USD_SDF_GLOB_PATTERN_H
8#define PXR_USD_SDF_GLOB_PATTERN_H
11#include "pxr/usd/sdf/api.h"
18PXR_NAMESPACE_OPEN_SCOPE
33class Sdf_GlobPattern {
35 Sdf_GlobPattern() =
default;
38 Sdf_GlobPattern(Sdf_GlobPattern
const &);
40 Sdf_GlobPattern &operator=(Sdf_GlobPattern
const &);
42 Sdf_GlobPattern(Sdf_GlobPattern &&) noexcept = default;
43 Sdf_GlobPattern &operator=(Sdf_GlobPattern &&) noexcept = default;
48 static Sdf_GlobPattern Compile(const
char *pattern,
size_t patLen);
49 static Sdf_GlobPattern Compile(
std::string_view pattern) {
50 return Compile(pattern.data(), pattern.size());
56 bool Match(
const char *str,
size_t len)
const;
57 bool Match(std::string_view str)
const {
58 return Match(str.data(), str.size());
62 explicit operator bool()
const {
63 return _flags & _Compiled;
69 static constexpr uint16_t _Compiled = 1u << 15;
71 std::unique_ptr<uint8_t[]> _buf;
72 uint16_t _bufSize = 0;
73 uint16_t _minBytes = 0;
75 uint16_t _suffixCodePointCount = 0;
78PXR_NAMESPACE_CLOSE_SCOPE