Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
escape-string.hh
Go to the documentation of this file.
1#pragma once
3
4#include <limits>
5#include <ostream>
6
7namespace nix {
8
20{
25 size_t maxLength = std::numeric_limits<size_t>::max();
26
31 bool outputAnsiColors = false;
32
41 bool escapeNonPrinting = false;
42};
43
56std::ostream &
57escapeString(std::ostream & output, std::string_view s, EscapeStringOptions options = {});
58
59inline std::ostream & escapeString(std::ostream & output, const char * s)
60{
61 return escapeString(output, std::string_view(s));
62}
63
64inline std::ostream & escapeString(std::ostream & output, const std::string & s)
65{
66 return escapeString(output, std::string_view(s));
67}
68
72std::string escapeString(std::string_view s, EscapeStringOptions options = {});
73
74inline std::string escapeString(const char * s, EscapeStringOptions options = {})
75{
76 return escapeString(std::string_view(s), options);
77}
78
79} // namespace nix
Definition escape-string.hh:20
bool escapeNonPrinting
Definition escape-string.hh:41
bool outputAnsiColors
Definition escape-string.hh:31
size_t maxLength
Definition escape-string.hh:25