/usr/include/globjects/base/formatString.h is in libglobjects-dev 1.1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | #pragma once
#include <iosfwd>
#include <string>
#include <globjects/globjects_api.h>
namespace globjects
{
GLOBJECTS_API int readInt(const char* str, int& number);
GLOBJECTS_API void parseFormat(std::ostream& stream, const char*& format);
GLOBJECTS_API void streamprintf(std::ostream& stream, const char* format);
/**
* Format a number of arguments and prints them to a stream.
*
* \see formatString
*/
template <typename T, typename... Args>
void streamprintf(std::ostream& stream, const char* format, const T& value, Args... args);
/**
* This function takes a format string and any number of arguments of different types.
* It works similar to printf, but is safer as it can infer the types.
* This also means that the type does not need to be encoded in the format string,
* instead they only indicate stream manipulators.
*
* Format syntax
* =============
*
* `%[alignment flag][independent flags][floatfield flag][fill character][width][precision][base];`
* `%[ l | r | i ][ a | # | + | u | p ]*[ e | f ][?<fill character>][<width>][.<precision>][ d | o | x ];`
*
* alignment flags
* ---------------
*
* flag | manipulator
* ---- | -----
* `l` | left
* `r` | right
* `i` | internal
*
* independent flags
* -----------------
*
* flag | manipulator
* ---- | -----
* `a` | boolalpha
* `#` | showbase
* `+` | showpos
* `u` | uppercase
* `p` | showpoint
* `0` | setfill(0) [redundant]
*
* floatfield flags
* ----------------
*
* flag | manipulator
* ---- | -----
* `e` | scientific
* `f` | fixed
*
* base
* ----
*
* flag | manipulator
* ---- | -----
* `d` | decimal
* `o` | octal
* `x` | hexadecimal
*
* In addition, if the base or floatfield flag is uppercase, it will automatically enable the uppercase flag without 'u'.
* Note: To end a format specifier, you have to add a semicolon.
* `%%` will escape a % character.
*
* \see http://www.cplusplus.com/reference/ios/ios_base/fmtflags/
*/
template <typename... Args>
std::string formatString(const char* format, Args... args);
} // namespace globjects
#include <globjects/base/formatString.inl>
|