From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,335f67c75a2a5d5,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-28 07:02:56 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.218.236.179.MISMATCH!news!news.he.net!newsfeed.direct.ca!look.ca!news1.tor.metronet.ca!nnrp1.tor.metronet.ca!not-for-mail Message-ID: <3A4B557F.F167C8E@home.com> From: "Warren W. Gay VE3WWG" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: In Plain Text: Tags.Internal_Tag(String'Input(Stream)) ?? References: <3A4AC329.9C2A311A@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 28 Dec 2000 15:02:55 GMT NNTP-Posting-Host: 198.96.47.195 NNTP-Posting-Date: Thu, 28 Dec 2000 08:02:55 MDT Organization: MetroNet Communications Group Inc. Xref: supernews.google.com comp.lang.ada:3419 Date: 2000-12-28T15:02:55+00:00 List-Id: (Apologies re: the prior post in HTML, here again in plain:) I want to read in WAVE file chunks using the S'Class'Input() facility. Each WAVE chunk starts with a String(1..4) that identifies the chunk. I have set up the external representation of each tagged record to match this chunk ID, for example: for Riff_Form'External_Tag use "RIFF"; However, the difficulty now is that I want to override the way the Tag is read in (the Tag length is ALWAYS 4 bytes here). The Ada implementation attempts to read in the lower bound and upper bound of the Tag string first [ See ref to the note about Tags.Internal_Tag(String'Input(Stream)) below ]. I would prefer not to override String'Input since this would affect it's behavour for all strings. This suggests that I have to define my own S'Class'Input() instead. This would allow me to read the tag in, in any way I please, but then how do I proceed from there? How does the Ada S'Class'Input() dispatch once the external tag is known? I.E. how do I "dispatch to the subprogram denoted by the Input attribute of the specific type identified by the internal tag; returning that result."???? I tried to find the GNAT implementation of this, but so far have been unsuccessful. Thanks in advance... >From the ARM : http://www.adapower.com/rm95/arm95_214.html#SEC214 1.S'Class'Input S'Class'Input denotes a function with the following specification: 1.function S'Class'Input( Stream : access Ada.Streams.Root_Stream_Type'Class) return T'Class 2.First reads the external tag from Stream and determines the corresponding internal tag (by calling Tags.Internal_Tag(String'Input(Stream)) -- See section 3.9 Tagged Types and Type Extensions.) and then dispatches to the subprogram denoted by the Input attribute of the specific type identified by the internal tag; returns that result. -- Warren W. Gay VE3WWG http://members.home.net/ve3wwg