mirror of
https://github.com/NixOS/nix
synced 2025-07-01 16:41:47 +02:00
nix path-info: Add --json flag
Also, factor out JSON generation from value-to-json.{cc,hh}, and support producing indented JSON.
This commit is contained in:
parent
9fa21765e7
commit
c0a7b84748
7 changed files with 476 additions and 133 deletions
|
@ -36,6 +36,7 @@ class Symbol;
|
|||
struct Pos;
|
||||
class EvalState;
|
||||
class XMLWriter;
|
||||
class JSONPlaceholder;
|
||||
|
||||
|
||||
typedef long NixInt;
|
||||
|
@ -73,7 +74,7 @@ class ExternalValueBase
|
|||
|
||||
/* Print the value as JSON. Defaults to unconvertable, i.e. throws an error */
|
||||
virtual void printValueAsJSON(EvalState & state, bool strict,
|
||||
std::ostream & str, PathSet & context) const;
|
||||
JSONPlaceholder & out, PathSet & context) const;
|
||||
|
||||
/* Print the value as XML. Defaults to unevaluated */
|
||||
virtual void printValueAsXML(EvalState & state, bool strict, bool location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue