Re: Add JSON, XML, CSV to Baby X resource compiler

Liste des GroupesRevenir à l c 
Sujet : Re: Add JSON, XML, CSV to Baby X resource compiler
De : malcolm.arthur.mclean (at) *nospam* gmail.com (Malcolm McLean)
Groupes : comp.lang.c
Date : 20. May 2024, 12:58:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2facc$3up6a$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 20/05/2024 10:23, Mikko wrote:
On 2024-05-19 22:41:36 +0000, bart said:
 
On 19/05/2024 11:16, Malcolm McLean wrote:
The Baby X resource compiler takes data - fonts, images, audio, strings - and converts them into C source so that they can be read by C programs without relying on external data files.
>
An obvious extension is to take in structured data. Adding SQL and querying a database would unfortuately mean extending the program so that it could only run on a large machine with a SQL server running, and isn't really a viable proposition. However JSON, XML, and CSV are commonly used to pass small to medium amounts of data about.
>
I've made a start on supporting CSV with the "<dataframe>" tag. CSV data is tabular and two dimensional, and lends itself to an arrray of simple structures. JSON And XML can of course represent more complex data, with hierarchy. The dataframe tag is still very experimental. I've never used it for anything practical.
>
So what would be the best approach to putting in JSON and XML support?
>
I've only briefly used XML.
>
The problem with XML is that the data it represents is not just hierarchical, but it can be chaotic. You can have one lot of data, followed by another for something else with a different structure, followed by other. It is just a container for disparate sets of data.
 Not just XML. JSON and may other formats have the same features.
 In order to put a resouce to a C program my preference is to convert
the resource to an array of characters or bytes and process it the
same way it would be processed if it were read from a file.
 
And of course the Baby X resource compiler already supports that. You can convert XML or JSON to a string, and then run your own parser over it at runtime.
But that isn't really a very good solution.
--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Date Sujet#  Auteur
19 May 24 * Add JSON, XML, CSV to Baby X resource compiler10Malcolm McLean
20 May 24 `* Re: Add JSON, XML, CSV to Baby X resource compiler9bart
20 May 24  +- Re: Add JSON, XML, CSV to Baby X resource compiler1Michael S
20 May 24  +* Re: Add JSON, XML, CSV to Baby X resource compiler3Mikko
20 May 24  i`* Re: Add JSON, XML, CSV to Baby X resource compiler2Malcolm McLean
21 May 24  i `- Re: Add JSON, XML, CSV to Baby X resource compiler1Mikko
20 May 24  `* Re: Add JSON, XML, CSV to Baby X resource compiler4bart
21 May 24   +* Re: Add JSON, XML, CSV to Baby X resource compiler2Malcolm McLean
22 May 24   i`- Re: Add JSON, XML, CSV to Baby X resource compiler1Ben Bacarisse
25 May 24   `- Re: Add JSON, XML, CSV to Baby X resource compiler1Malcolm McLean

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal