//===-- string_utils.cpp ----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "string_utils.h" #include "common.h" #include <stdarg.h> #include <string.h> namespace scudo { // Appends number in a given Base to buffer. If its length is less than // |MinNumberLength|, it is padded with leading zeroes or spaces, depending // on the value of |PadWithZero|. void ScopedString::appendNumber(u64 AbsoluteValue, u8 Base, u8 MinNumberLength, bool PadWithZero, bool Negative, bool Upper) { … } void ScopedString::appendUnsigned(u64 Num, u8 Base, u8 MinNumberLength, bool PadWithZero, bool Upper) { … } void ScopedString::appendSignedDecimal(s64 Num, u8 MinNumberLength, bool PadWithZero) { … } // Use the fact that explicitly requesting 0 Width (%0s) results in UB and // interpret Width == 0 as "no Width requested": // Width == 0 - no Width requested // Width < 0 - left-justify S within and pad it to -Width chars, if necessary // Width > 0 - right-justify S, not implemented yet void ScopedString::appendString(int Width, int MaxChars, const char *S) { … } void ScopedString::appendPointer(u64 ptr_value) { … } void ScopedString::vappend(const char *Format, va_list &Args) { … } void ScopedString::append(const char *Format, ...) { … } void Printf(const char *Format, ...) { … } } // namespace scudo