Add String Formatting Util
(Merged from http://go/wvgerrit/160042.) Since we don't have access to std::format yet, this patch adds a function to wvutil to format text into a std::string. Bug: 255466913 Test: x86-64 Test: raven Change-Id: I28043da76af5b4772a29fa7e7241343caf9b54a1
This commit is contained in:
committed by
John Bruce
parent
a3e67a9104
commit
ff73463d0b
18
libwvdrmengine/cdm/util/include/string_format.h
Normal file
18
libwvdrmengine/cdm/util/include/string_format.h
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
#ifndef WVCDM_UTIL_STRING_FORMAT_H_
|
||||
#define WVCDM_UTIL_STRING_FORMAT_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace wvutil {
|
||||
|
||||
#ifdef __GNUC__
|
||||
[[gnu::format(printf, 2, 3)]]
|
||||
#endif
|
||||
bool FormatString(std::string* out, const char* fmt, ...);
|
||||
|
||||
} // namespace wvutil
|
||||
|
||||
#endif // WVCDM_UTIL_STRING_FORMAT_H_
|
||||
Reference in New Issue
Block a user