aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Parsers/ASTIdentifier_fwd.h
blob: 01cfbb8fec71de82bd09bbb8d1952c90e64ae9cf (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
36
37
38
39
40
#pragma once

#include <Parsers/IAST_fwd.h>
#include <base/types.h>

#include <optional>
#include <vector>

namespace DB
{

class ASTIdentifier;
class ASTTableIdentifier;

/// ASTIdentifier Helpers: hide casts and semantic.

void setIdentifierSpecial(ASTPtr & ast);

String getIdentifierName(const IAST * ast);

std::optional<String> tryGetIdentifierName(const IAST * ast);

bool tryGetIdentifierNameInto(const IAST * ast, String & name);

inline String getIdentifierName(const ASTPtr & ast)
{
    return getIdentifierName(ast.get());
}

inline std::optional<String> tryGetIdentifierName(const ASTPtr & ast)
{
    return tryGetIdentifierName(ast.get());
}

inline bool tryGetIdentifierNameInto(const ASTPtr & ast, String & name)
{
    return tryGetIdentifierNameInto(ast.get(), name);
}

}