aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/minikql/jsonpath/rewrapper/re.h
blob: 3f564ad1ad5d2a13325ab6497cbdf64232b828d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <memory>

#include <util/generic/fwd.h>
#include <util/generic/yexception.h>

namespace NReWrapper {

class TCompileException : public yexception {
};

enum EFlags {
    FLAGS_CASELESS = 1,
};

class IRe {
public:
    virtual ~IRe() = default;
    virtual bool Matches(const TStringBuf& text) const = 0;
    virtual TString Serialize() const = 0;
};

using IRePtr = std::unique_ptr<IRe>;

namespace NDispatcher {
    IRePtr Compile(const TStringBuf& regex, unsigned int flags, ui32 id);
    IRePtr Deserialize(const TStringBuf& serializedRegex);
}

}