forked from lix-project/lix
Unindent print.hh
declarations
(cherry picked from commit c9125603a535f82cc9a53f47533f0a3d174e7008)
Change-Id: I137a272feee7eb42a017f373cbe4705b0e79b7c1
This commit is contained in:
parent
80b79d0137
commit
0e8f505f66
|
@ -10,38 +10,39 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
/**
|
|
||||||
|
/**
|
||||||
* Print a string as a Nix string literal.
|
* Print a string as a Nix string literal.
|
||||||
*
|
*
|
||||||
* Quotes and fairly minimal escaping are added.
|
* Quotes and fairly minimal escaping are added.
|
||||||
*
|
*
|
||||||
* @param s The logical string
|
* @param s The logical string
|
||||||
*/
|
*/
|
||||||
std::ostream & printLiteralString(std::ostream & o, std::string_view s);
|
std::ostream & printLiteralString(std::ostream & o, std::string_view s);
|
||||||
inline std::ostream & printLiteralString(std::ostream & o, const char * s) {
|
inline std::ostream & printLiteralString(std::ostream & o, const char * s) {
|
||||||
return printLiteralString(o, std::string_view(s));
|
return printLiteralString(o, std::string_view(s));
|
||||||
}
|
}
|
||||||
inline std::ostream & printLiteralString(std::ostream & o, const std::string & s) {
|
inline std::ostream & printLiteralString(std::ostream & o, const std::string & s) {
|
||||||
return printLiteralString(o, std::string_view(s));
|
return printLiteralString(o, std::string_view(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Print `true` or `false`. */
|
/** Print `true` or `false`. */
|
||||||
std::ostream & printLiteralBool(std::ostream & o, bool b);
|
std::ostream & printLiteralBool(std::ostream & o, bool b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a string as an attribute name in the Nix expression language syntax.
|
* Print a string as an attribute name in the Nix expression language syntax.
|
||||||
*
|
*
|
||||||
* Prints a quoted string if necessary.
|
* Prints a quoted string if necessary.
|
||||||
*/
|
*/
|
||||||
std::ostream & printAttributeName(std::ostream & o, std::string_view s);
|
std::ostream & printAttributeName(std::ostream & o, std::string_view s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns `true' is a string is a reserved keyword which requires quotation
|
* Returns `true' is a string is a reserved keyword which requires quotation
|
||||||
* when printing attribute set field names.
|
* when printing attribute set field names.
|
||||||
*/
|
*/
|
||||||
bool isReservedKeyword(const std::string_view str);
|
bool isReservedKeyword(const std::string_view str);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a string as an identifier in the Nix expression language syntax.
|
* Print a string as an identifier in the Nix expression language syntax.
|
||||||
*
|
*
|
||||||
* FIXME: "identifier" is ambiguous. Identifiers do not have a single
|
* FIXME: "identifier" is ambiguous. Identifiers do not have a single
|
||||||
|
@ -50,5 +51,6 @@ namespace nix {
|
||||||
* expression, or something else entirely, like JSON. Use one of the
|
* expression, or something else entirely, like JSON. Use one of the
|
||||||
* `print*` functions instead.
|
* `print*` functions instead.
|
||||||
*/
|
*/
|
||||||
std::ostream & printIdentifier(std::ostream & o, std::string_view s);
|
std::ostream & printIdentifier(std::ostream & o, std::string_view s);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue