Value indent delta format

This commit is contained in:
Michael Davidsaver
2021-01-28 07:44:32 -08:00
parent 1aa0f1a611
commit 10c1d5ac3b
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ struct FmtDelta {
if(verytop && !val.isMarked())
return;
strm<<prefix;
strm<<indent{}<<prefix;
if(!verytop)
strm<<" ";
strm<<val.type().name();
@@ -82,7 +82,7 @@ struct FmtDelta {
for(auto idx : range(aval.size())) {
std::ostringstream strm;
strm<<prefix<<'['<<idx<<']';
strm<<indent{}<<prefix<<'['<<idx<<']';
top(strm.str(), aval[idx], false);
}
@@ -100,7 +100,7 @@ struct FmtDelta {
void top(const std::string& prefix, const Value& val, bool verytop)
{
if(!val) {
strm<<prefix;
strm<<indent{}<<prefix;
if(!verytop)
strm<<' ';
strm<<"null\n";
+3 -1
View File
@@ -111,7 +111,9 @@ int main(int argc, char *argv[])
ops.push_back(ctxt.get(argv[n])
.pvRequest(request)
.result([&argv, n, &remaining, &done, format, arrLimit](client::Result&& result) {
std::cout<<argv[n]<<"\n"<<result()
std::cout<<argv[n]<<"\n";
Indented I(std::cout);
std::cout<<result()
.format()
.format(format)
.arrayLimit(arrLimit);