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