1 //===-- StringConvert.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_StringConvert_h_
11 #define liblldb_StringConvert_h_
17 namespace lldb_private {
19 namespace StringConvert {
21 //----------------------------------------------------------------------
22 /// @namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h"
23 /// Utility classes for converting strings into Integers
24 //----------------------------------------------------------------------
26 int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0,
27 bool *success_ptr = nullptr);
29 uint32_t ToUInt32(const char *s, uint32_t fail_value = 0, int base = 0,
30 bool *success_ptr = nullptr);
32 int64_t ToSInt64(const char *s, int64_t fail_value = 0, int base = 0,
33 bool *success_ptr = nullptr);
35 uint64_t ToUInt64(const char *s, uint64_t fail_value = 0, int base = 0,
36 bool *success_ptr = nullptr);
38 double ToDouble(const char *s, double fail_value = 0.0,
39 bool *success_ptr = nullptr);
40 } // namespace StringConvert
41 } // namespace lldb_private