From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org>
Subject: Re: Using Ada.Containers.Vector and Limited Private types
Date: Fri, 11 Jul 2008 22:06:58 GMT
Date: 2008-07-11T22:06:58+00:00 [thread overview]
Message-ID: <6QQdk.194211$TT4.37376@attbi_s22> (raw)
In-Reply-To: <4c5bfeb0-daa0-45e4-82f0-eebabda565e9@d45g2000hsc.googlegroups.com>
Gene wrote:
>
> But as Dmitry pointed out, what I wrote has some portability risk. To
> avoid this, just copy the bits you need into your own (non-limited)
> data structure.
>
> with Ada.Text_IO; use Ada.Text_IO;
> with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
> with Ada.Containers.Vectors;
> with Ada.Directories; use Ada.Directories;
> with Ada.Calendar; use Ada.Calendar; -- for comparing date/
> times
>
> procedure List_By_Date is
>
> type String_Ptr_Type is access String;
> type File_Info_Type is
> record
> Modification_Time : Time;
> Simple_Name : String_Ptr_Type; -- Freed with storage pool!
I would recommend using Ada.Strings.Unbounded.Unbounded_String with its
automatic and tested memory management over implementing new and untested memory
allocation and management yourself.
--
Jeff Carter
"Well, a gala day is enough for me. I don't think
I can handle any more."
Duck Soup
93
next prev parent reply other threads:[~2008-07-11 22:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 11:53 Using Ada.Containers.Vector and Limited Private types Dale Stanbrough
2008-07-05 15:42 ` george.priv
2008-07-06 18:09 ` Gene
2008-07-06 19:18 ` Dmitry A. Kazakov
2008-07-07 13:29 ` Gene
2008-07-07 14:15 ` Dmitry A. Kazakov
2008-07-07 18:39 ` Gene
2008-07-10 0:16 ` Dale Stanbrough
2008-07-10 7:31 ` Dmitry A. Kazakov
2008-07-10 22:59 ` Gene
2008-07-11 22:06 ` Jeffrey R. Carter [this message]
2008-07-12 2:45 ` Gene
2008-07-12 4:41 ` Jeffrey R. Carter
2008-07-13 15:30 ` Gene
2008-07-13 18:10 ` Jeffrey R. Carter
2008-07-16 21:23 ` Simon Wright
2008-07-12 8:02 ` Dmitry A. Kazakov
2008-07-12 7:53 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox