-
-
Notifications
You must be signed in to change notification settings - Fork 642
/
Copy patherrors.cpp
38 lines (36 loc) · 1.75 KB
/
errors.cpp
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
/* Copyright 2021 - 2025 R. Thomas
* Copyright 2021 - 2025 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "LIEF/errors.hpp"
const char* to_string(lief_errors err) {
switch (err) {
case lief_errors::read_error: return "read_error";
case lief_errors::not_found: return "not_found";
case lief_errors::not_implemented: return "not_implemented";
case lief_errors::not_supported: return "not_supported";
case lief_errors::corrupted: return "corrupted";
case lief_errors::conversion_error: return "conversion_error";
case lief_errors::read_out_of_bound: return "read_out_of_bound";
case lief_errors::asn1_bad_tag: return "asn1_bad_tag";
case lief_errors::file_error: return "file_error";
case lief_errors::file_format_error: return "file_format_error";
case lief_errors::parsing_error: return "parsing_error";
case lief_errors::build_error: return "build_error";
case lief_errors::data_too_large: return "data_too_large";
case lief_errors::require_extended_version: return "require_extended_version";
default: return "error";
}
return "error";
}