aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/ast/yql_ast_escaping.h
blob: 744ab9851610a6c3d50a996fc5ad359831d9c140 (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
32
33
34
35
#pragma once

#include <util/generic/fwd.h>
#include <util/system/types.h>
#include <util/generic/strbuf.h>


class IOutputStream;

namespace NYql {

enum class EUnescapeResult
{
    OK,
    INVALID_ESCAPE_SEQUENCE,
    INVALID_BINARY,
    INVALID_OCTAL,
    INVALID_HEXADECIMAL,
    INVALID_UNICODE,
    INVALID_END,
};

TStringBuf UnescapeResultToString(EUnescapeResult result);

void EscapeArbitraryAtom(TStringBuf atom, char quoteChar, IOutputStream* out);

EUnescapeResult UnescapeArbitraryAtom(
        TStringBuf atom, char endChar, IOutputStream* out, size_t* readBytes);

void EscapeBinaryAtom(TStringBuf atom, char quoteChar, IOutputStream* out);

EUnescapeResult UnescapeBinaryAtom(
        TStringBuf atom, char endChar, IOutputStream* out, size_t* readBytes);

} // namspace NYql