[cad-linux-dev] Re: Drawing entity

  • From: Bruno Postle <bruno@xxxxxxxxxx>
  • To: CAD linux development <cad-linux-dev@xxxxxxxxxxxxx>
  • Date: Sat, 21 Aug 2004 16:16:14 +0100

On Fri 20-Aug-2004 at 12:51 -0500, Eric Wilhelm wrote:
> 
> Okay, but I still don't see it as practical to have multiple
> versions of a format within a single directory.  How would your
> code handle this?

Dunno, haven't written it yet ;-)

Say that a circle entity exists as a version "foo" file, the
coordinates of the centre-point could be found here:

   ./my-circle.yml#point

(this is using a hypothetical notation system where internal
attributes of elements can be addressed directly after the #)

However in version "bar" of the circle file format, the centre-point
might be found here:

   ./my-circle.yml#points/0

The application knows to use the YAML parser from the file
extension.  To access the centre-point, all it needs to do is
look-up the ./my-circle.yml#version and ./my-circle.yml#type
attributes and see if it has the code to handle a "foo" or "bar"
formatted "circle" - Otherwise it skips the file with a warning.

So the "version" and "type" attributes combined have basically the
same function as an XML DOCTYPE declaration.

-- 
Bruno

Other related posts: