aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/select/parse_utils.h
blob: 443670e5b870d7128b25a33738586f7d3935851f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <cstdint>
#include <cstddef>

namespace document::select::util {

// Fast, locale-independent numeric parse helpers for Flex lexing.

// For all parse_* functions, returns true if parsing is successful. False otherwise.
// Value of `out` is undefined if return value is false.
bool parse_hex_i64(const char* str, size_t len, int64_t& out);
bool parse_i64(const char* str, size_t len, int64_t& out);
bool parse_double(const char* str, size_t len, double& out);

}