1. 11 5月, 2015 1 次提交
  2. 10 2月, 2015 1 次提交
  3. 06 2月, 2015 1 次提交
    • A
      QJSON: Add JSON writer · 190c882c
      Alexander Graf 提交于
      To support programmatic JSON assembly while keeping the code that generates it
      readable, this patch introduces a simple JSON writer. It emits JSON serially
      into a buffer in memory.
      
      The nice thing about this writer is its simplicity and low memory overhead.
      Unlike the QMP JSON writer, this one does not need to spawn QObjects for every
      element it wants to represent.
      
      This is a prerequisite for the migration stream format description generator.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      190c882c
  4. 13 1月, 2013 1 次提交
  5. 19 12月, 2012 1 次提交
  6. 01 10月, 2010 1 次提交
    • D
      Add support for JSON pretty printing · 212b6008
      Daniel P. Berrange 提交于
      The monitor does not pretty-print JSON output, so that everything
      will be on a single line reply. When JSON docs get large this is
      quite unpleasant to read. For the future command line capabilities
      query ability, huge JSON docs will be available. This needs the
      ability to pretty-print.
      
      This introduces a new API qobject_to_json_pretty() that does
      a minimal indentation of list and dict members. As an example,
      this makes
      
        {"QMP": {"version": {"micro": 50, "minor": 12, "package": "", "major": 0}, "capabilities": []}}
      
      Output as
      
        {
            "QMP": {
                "version": {
                    "micro": 50,
                    "minor": 12,
                    "package": "",
                    "major": 0
                },
                "capabilities": [
                ]
            }
        }
      
      NB: this is not turned on for the QMP monitor.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      212b6008
  7. 12 6月, 2010 1 次提交
  8. 11 2月, 2010 1 次提交
  9. 27 1月, 2010 1 次提交
    • A
      json: escape u0000 .. u001F when outputting json · ff06ea21
      Anthony Liguori 提交于
      Markus Armbruster pointed out:
      
      JSON requires control characters in strings to be escaped.  RFC 4627
      section 2.5:
      
         A string begins and ends with quotation marks.  All Unicode
         characters may be placed within the quotation marks except for the
         characters that must be escaped: quotation mark, reverse solidus, and
         the control characters (U+0000 through U+001F).
      
      We've been quoting the special escape sequences that JSON defines but we
      haven't been encoding the full control character range.  This patch fixes that.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ff06ea21
  10. 03 12月, 2009 2 次提交
  11. 17 11月, 2009 2 次提交