Update Documentation - What is new in Ring 1.5? - Better RingQt.
@@ -371,6 +371,97 @@ Screen Shot:
Better RingQt
=============
+New classes added to RingQt :
+
+* QStringRef
+* QMutex
+* QMutexLocker
+
+Example:
+
+.. code-block:: ring
+
+ ### Submits your car VIN - Vehicle Id Number - to the Web Site - vpic.nhtsa.dot.gov -
+ ### Parses XML data returned
+ ### Prints out the car info result
+
+ load "libcurl.ring"
+ load "guilib.ring"
+ load "stdlib.ring"
+
+ curl = curl_easy_init();
+
+ # request = "3G1JC5248YS251015?format=xml" ### VIN - Chevrolet
+ request = "3GYFK62847G247323?format=xml" ### VIN - Cadillac
+
+ call_type = "decodevinvalues/"
+ url = "https://vpic.nhtsa.dot.gov/api/vehicles/"
+ url_request = url + call_type + request
+
+ See "URL Request: "+ url_request +nl
+
+ curl_easy_setopt(curl, curlopt_url, url_request)
+ response = curl_easy_perform_silent(curl);
+
+ See nl +"Response Raw: "+ response +nl +nl
+
+ curl_easy_cleanup(curl)
+
+ xml = new qxmlstreamreader()
+ xml.adddata_2(response)
+
+ x = new qstringref()
+ while not xml.atend()
+ if xml.error()
+ see xml.errorstring() see nl
+ exit loop
+ ok
+
+ x = xml.text()
+ if not x.length() = 0
+ see "Length: " see x.length() +" --- "
+ see "Value: " see x.tostring() see nl
+ ok
+
+ xml.readnext()
+ end
+
+ get x
+
+ ###------------------------------------------
+ ### Results
+ #
+ # ==>Value: 115
+ # ==>Value: Results returned successfully
+ # ==>Value: VIN(s): 3G1JC5248YS251015
+ # ==>Value: 3G1JC5248YS251015
+ # ==>Value: Sedan/Saloon
+ # ==>Value: 4
+ # ==>Value: 2200.0
+ # ==>Value: 134.25223700841
+ # ==>Value: 2.2
+ # ==>Value: 4
+ # ==>Value: LN2
+ # ==>Value: CHEVROLET
+ # ==>Value: GENERAL MOTORS LLC
+ # ==>Value: Cavalier
+ # ==>Value: 2000
+ # ==>Value: Ramos Arzipe
+ # ==>Value: PASSENGER CAR
+ # ==>Value: 4
+ # ==>Value: In-Line
+ # ==>Value: 1st Row (Driver & Passenger)
+ # ==>Value: Sequential Fuel Injection (SFI)
+ # ==>Value: Mexico
+ # ==>Value: NA
+ # ==>Value: Manual
+ # ==>Value: Body Type: Sedan, 4-6 Window, Notchback (GM codes: 19, 69)
+ # ==>Value: Name Plate: Chevrolet, Pontiac
+ # ==>Value: 0 - VIN decoded clean. Check Digit (9th position) is correct
+ # ==>Value: LAN
+ # ==>Value: 984
+ #
+ ###-----------------------------------------
.. index::
pair: What is new in Ring 1.5?; Better Objects Library
