aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/types/dynumber/dynumber.h
blob: f64d1a294f33b1f96ed623a0dcf1b64ce9ccad6f (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/buffer.h>
#include <util/generic/maybe.h>

namespace NKikimr::NDyNumber {

/**
 * DyNumber is a variable-length format to store large numbers.
 * Along with binary representation of DyNumber we declare string representation.
 * It lacks the original format properties but is human readable and can be passed to
 * other storage systems.
 */

/**
 * @brief Checks if buffer stores valid binary representation of DyNumber
 */
bool IsValidDyNumber(TStringBuf buffer);

/**
 * @brief Checks if buffer stores valid string representation of DyNumber
 */
bool IsValidDyNumberString(TStringBuf str);

/**
 * @brief Parses DyNumber string representation into binary one
 */
TMaybe<TString> ParseDyNumberString(TStringBuf str);

/**
 * @brief Converts DyNumber binary representation into string one
 */
TMaybe<TString> DyNumberToString(TStringBuf buffer);

}