HISE Logo Forum
    • Categories
    • Register
    • Login

    JSON.parse or parseJSON

    Scheduled Pinned Locked Moved Feature Requests
    jsonstringconvert
    7 Posts 3 Posters 663 Views
    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.healeyD
      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 HartC 1 Reply Last reply Reply Quote 2
      • Christoph HartC
        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.healeyD 1 Reply Last reply Reply Quote 1
        • d.healeyD
          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.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            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 HartC 1 Reply Last reply Reply Quote 3
            • Christoph HartC
              Christoph Hart @d.healey
              last edited by

              @d-healey Nice one.

              1 Reply Last reply Reply Quote 0
              • A
                aaronventure
                last edited by

                please add this to the API in HISE and the docs. this is great.

                A 1 Reply Last reply Reply Quote 0
                • A
                  aaronventure @aaronventure
                  last edited by

                  @aaronventure bump

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

                  12

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  102.6k

                  Posts