Forum

    • Register
    • Login
    • Search
    • Categories

    JSON.parse or parseJSON

    Feature Requests
    json string convert
    2
    5
    31
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healey
      d.healey last edited by

      Is there a way to convert a string to JSON? If not, could we get one?

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      Christoph Hart 1 Reply Last reply Reply Quote 1
      • Christoph Hart
        Christoph Hart @d.healey last edited by

        @d-healey You can write it to a file, then load it back with File.loadFileFromObject(). Or if you don't want to do the equivalent of printing out an email and then scan it to send a PDF because you don't know the Export to PDF function, you can add a wrapper around the JUCE function JSON::parse

        The Javascript standard seems to be JSON.parse(), but I don't want to add a API class just for that single method, so we could add it to the String class?

        var x = "1234";
        var xAsObj = x.parseAsJSON();
        
        // This is already possible
        var xAsObjAsText = trace(xAsObj);
        
        d.healey 1 Reply Last reply Reply Quote 1
        • d.healey
          d.healey @Christoph Hart last edited by

          @christoph-hart Sounds good to me. I'll add it to the API. Thanks!

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          d.healey 1 Reply Last reply Reply Quote 0
          • d.healey
            d.healey @d.healey last edited by

            Done https://github.com/christophhart/HISE/pull/240

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            Christoph Hart 1 Reply Last reply Reply Quote 1
            • Christoph Hart
              Christoph Hart @d.healey last edited by

              @d-healey Nice one.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              20
              Online

              741
              Users

              5.4k
              Topics

              50.3k
              Posts