StringConvert.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- StringConvert.h -----------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_HOST_STRINGCONVERT_H
  9. #define LLDB_HOST_STRINGCONVERT_H
  10. #include <cstdint>
  11. namespace lldb_private {
  12. namespace StringConvert {
  13. /// \namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h"
  14. /// Utility classes for converting strings into Integers
  15. int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0,
  16. bool *success_ptr = nullptr);
  17. uint32_t ToUInt32(const char *s, uint32_t fail_value = 0, int base = 0,
  18. bool *success_ptr = nullptr);
  19. int64_t ToSInt64(const char *s, int64_t fail_value = 0, int base = 0,
  20. bool *success_ptr = nullptr);
  21. uint64_t ToUInt64(const char *s, uint64_t fail_value = 0, int base = 0,
  22. bool *success_ptr = nullptr);
  23. double ToDouble(const char *s, double fail_value = 0.0,
  24. bool *success_ptr = nullptr);
  25. } // namespace StringConvert
  26. } // namespace lldb_private
  27. #endif