public YAMLWriter(TextWriter tw, int initialdepth, int horizontalthresh, IDictionary <Type, bool> bbd) { Depth = new string(' ', initialdepth); HorizontalThresh = horizontalthresh; Lw = new LineWriter(tw, 0); BBD = bbd; VertWriter = new LeafWriter(this, VertNeedsQuotes, s => LineBreak.IsMatch(s)); HorizontalArrWriter = new LeafWriter(this, HArrNeedsQuotes, s => false); HorizontalDicWriter = new LeafWriter(this, HDicNeedsQuotes, s => false); }
int GetMaxKey(LeafWriter lw, int idx, int childdepth) { int m = 0; do { var r = List[idx]; if (r.Depth == childdepth) { if (r.Key != null) { int l = lw.Escape(r.Key.ToString()).Length; if (m < l) { m = l; } } } ++idx; } while(idx != List.Count && List[idx].Depth >= childdepth); return(m > 20?20:m); }
int GetMaxKey(LeafWriter lw,int idx,int childdepth) { int m=0; do { var r=List[idx]; if(r.Depth==childdepth) { if(r.Key!=null) { int l=lw.Escape(r.Key.ToString()).Length; if(m<l) m=l; } } ++idx; } while(idx!=List.Count && List[idx].Depth>=childdepth); return m>20?20:m; }
public YAMLWriter(TextWriter tw,int initialdepth,int horizontalthresh,IDictionary<Type,bool> bbd) { Depth=new string(' ',initialdepth); HorizontalThresh=horizontalthresh; Lw=new LineWriter(tw,0); BBD=bbd; VertWriter=new LeafWriter(this,VertNeedsQuotes,s=>LineBreak.IsMatch(s)); HorizontalArrWriter=new LeafWriter(this,HArrNeedsQuotes,s=>false); HorizontalDicWriter=new LeafWriter(this,HDicNeedsQuotes,s=>false); }