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_
18 // Other libraries and framework includes
21 namespace lldb_private {
23 namespace StringConvert {
25 //----------------------------------------------------------------------
26 /// @namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h"
27 /// @brief Utility classes for converting strings into Integers
28 //----------------------------------------------------------------------
30 int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0,
31 bool *success_ptr = nullptr);
33 uint32_t ToUInt32(const char *s, uint32_t fail_value = 0, int base = 0,
34 bool *success_ptr = nullptr);
36 int64_t ToSInt64(const char *s, int64_t fail_value = 0, int base = 0,
37 bool *success_ptr = nullptr);
39 uint64_t ToUInt64(const char *s, uint64_t fail_value = 0, int base = 0,
40 bool *success_ptr = nullptr);
42 double ToDouble(const char *s, double fail_value = 0.0,
43 bool *success_ptr = nullptr);
44 } // namespace StringConvert
45 } // namespace lldb_private