diff options
author | Rebecca Turner <rbt@sent.as> | 2024-03-28 16:26:42 -0700 |
---|---|---|
committer | Rebecca Turner <rbt@sent.as> | 2024-03-29 16:26:29 -0700 |
commit | a5a25894c152848d1a57f97b2ef5542ddf6cdb9d (patch) | |
tree | ea623d3e50f133b6f1d651847eef67e9172a3218 /src/libutil/print-elided.hh | |
parent | 5a54b0a20c80356de5098694353f506e73fb883f (diff) |
Move `escapeString` to its own file
Change-Id: Ie5c954ec73c46c9d3c679ef99a83a29cc7a08352
Diffstat (limited to 'src/libutil/print-elided.hh')
-rw-r--r-- | src/libutil/print-elided.hh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libutil/print-elided.hh b/src/libutil/print-elided.hh new file mode 100644 index 000000000..a99b15ca1 --- /dev/null +++ b/src/libutil/print-elided.hh @@ -0,0 +1,23 @@ +#pragma once + +#include <ostream> + + +namespace nix { + +/** + * Print an `«... elided»` placeholder. + * + * Arguments are forwarded to `pluralize`. + * + * If `ansiColors` is set, the output will be wrapped in `ANSI_FAINT`. + */ +void printElided( + std::ostream & output, + unsigned int value, + const std::string_view single, + const std::string_view plural, + bool ansiColors +); + +} |