Exemple #1
0
 private string _format(ParameterSet set) {
    var f = new BplJsonFormatter { PrettyPrint = false, StronglyTyped = true, SkipDefaults = false };
    if (f.Format(set)) {
       return f.Output;
    }
    return null;
 }
 private BplDocumentFormatter _invokeFormatter(BplFormat format, BplObject input) {
    BplDocumentFormatter formatter = null;
    switch (format) {
       case BplFormat.Xml:
          formatter = new BplXmlFormatter { PrettyPrint = true };
          break;
       case BplFormat.Json:
          formatter = new BplJsonFormatter { PrettyPrint = true, StronglyTyped = false };
          break;
       case BplFormat.Json_t:
          formatter = new BplJsonFormatter { PrettyPrint = true, StronglyTyped = true };
          break;
       case BplFormat.Binary:
          formatter = new BplHexFormatter { };
          break;
       default:
          return null;
    }
    if (formatter != null) {
       formatter.Format(input);
    }
    return formatter;
 }
Exemple #3
0
 public TextBuffer(BplJsonFormatter jsonFormatter) {
    _buffer = new StringBuilder(2048);
    _indent = "";
    _prettyPrint = jsonFormatter.PrettyPrint;
    _indentChars = jsonFormatter.IndentChars;
    _newlineChars = jsonFormatter.NewLineChars;
 }