/src/solidity/libsolutil/UTF8.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | This file is part of solidity. |
3 | | |
4 | | solidity is free software: you can redistribute it and/or modify |
5 | | it under the terms of the GNU General Public License as published by |
6 | | the Free Software Foundation, either version 3 of the License, or |
7 | | (at your option) any later version. |
8 | | |
9 | | solidity is distributed in the hope that it will be useful, |
10 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | | GNU General Public License for more details. |
13 | | |
14 | | You should have received a copy of the GNU General Public License |
15 | | along with solidity. If not, see <http://www.gnu.org/licenses/>. |
16 | | */ |
17 | | // SPDX-License-Identifier: GPL-3.0 |
18 | | /** @file UTF8.h |
19 | | * @author Alex Beregszaszi |
20 | | * @date 2016 |
21 | | * |
22 | | * UTF-8 related helpers |
23 | | */ |
24 | | |
25 | | #pragma once |
26 | | |
27 | | #include <string> |
28 | | |
29 | | namespace solidity::util |
30 | | { |
31 | | |
32 | | /// Validate an input for UTF8 encoding |
33 | | /// @returns false if it is invalid and the first invalid position in invalidPosition |
34 | | bool validateUTF8(std::string const& _input, size_t& _invalidPosition); |
35 | | |
36 | | inline bool validateUTF8(std::string const& _input) |
37 | 0 | { |
38 | 0 | size_t invalidPos; |
39 | 0 | return validateUTF8(_input, invalidPos); |
40 | 0 | } |
41 | | |
42 | | } |