xref: /aosp_15_r20/external/libchrome-gestures/include/string_util.h (revision aed3e5085e770be5b69ce25295ecf6ddf906af95)
1 // Copyright 2014 The ChromiumOS Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef GESTURES_STRING_UTIL_H_
6 #define GESTURES_STRING_UTIL_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "include/compiler_specific.h"
12 
13 namespace gestures {
14 
15 // Return a C++ string given printf-like input.
16 std::string StringPrintf(const char* format, ...)
17       PRINTF_FORMAT(1, 2);
18 
19 // Lower-level routine that takes a va_list and appends to a specified
20 // string.  All other routines are just convenience wrappers around it.
21 void StringAppendV(std::string* dst, const char* format, va_list ap)
22     PRINTF_FORMAT(2, 0);
23 
24 // Trims whitespace from the start and end of the input string.  This function
25 // is for ASCII strings and only looks for ASCII whitespace.
26 std::string TrimWhitespaceASCII(const std::string& input);
27 
28 }  // namespace gestures
29 
30 #endif  // GESTURES_STRING_UTIL_H_
31