Index

Package: Zip_Streams

Description

package Zip_Streams is
Contributed by ITEC - NXP Semiconductors June 2008 The Zip_Streams package defines an abstract stream type, Root_Zipstream_Type, with name, time and an index for random access. In addition, this package provides two ready - to - use derivations: - Memory_Zipstream, for using in - memory streaming - File_Zipstream, for accessing files Change log: ========== 20 - Jul - 2011 : GdM/JH : - Underscore in Get_Name, Set_Name, Get_Time, Set_Time - The 4 methods above are not anymore abstract - Name and Modification_Time fields moved to Root_Zipstream_Type - Unbounded_Stream becomes Memory_Zipstream - ZipFile_Stream becomes File_Zipstream 17 - Jul - 2011 : JH : Added Set_Unicode_Name_Flag, Is_Unicode_Name 25 - Nov - 2009 : GdM : Added an own time type - > it is possible to bypass Ada.Calendar 18 - Jan - 2009 : GdM : Fixed Zip_Streams.Read which did read only Item's first element

Packages

Calendar

Classes

Root_Zipstream_Type (abstract)

type Root_Zipstream_Type is abstract new Ada.Streams.Root_Stream_Type with private;

Ancestors:

Ada.Streams.Root_Stream_Type

Immediate Children:

Primitive operations:

Ada.Streams.Read (Inherited)
Ada.Streams.Write (Inherited)
End_Of_Stream
Is_Unicode_Name
Set_Unicode_Name_Flag

Memory_Zipstream

type Memory_Zipstream is new Root_Zipstream_Type with private;

Ancestors:

Ada.Streams.Root_Stream_Type

Immediate Children:

Primitive operations:

End_Of_Stream (overriding End_Of_Stream)
Get_Name (Inherited)
Get_Time (Inherited)
Index (overriding Index)
Is_Unicode_Name (Inherited)
Read (overriding Ada.Streams.Read)
Set_Index (overriding Set_Index)
Set_Name (Inherited)
Set_Time (Inherited)
Set_Unicode_Name_Flag (Inherited)
Size (overriding Size)
Write (overriding Ada.Streams.Write)
------------------------------------------------------------------- Unbounded_Stream : stream based on an in - memory Unbounded_String -- -------------------------------------------------------------------

File_Zipstream

type File_Zipstream is new Root_Zipstream_Type with private;

Ancestors:

Ada.Streams.Root_Stream_Type

Immediate Children:

Primitive operations:

End_Of_Stream (overriding End_Of_Stream)
Get_Name (Inherited)
Get_Time (Inherited)
Index (overriding Index)
Is_Unicode_Name (Inherited)
Read (overriding Ada.Streams.Read)
Set_Index (overriding Set_Index)
Set_Name (Inherited)
Set_Time (Inherited)
Set_Unicode_Name_Flag (Inherited)
Size (overriding Size)
Write (overriding Ada.Streams.Write)

References:

zip_streams.ads:125:9 (declaration)
unzip-streams.adb:190:31 (reference)
unzip.adb:456:31 (reference)
unzip.adb:505:31 (reference)
unzip.adb:551:31 (reference)
unzip.adb:639:31 (reference)
unzip.adb:694:31 (reference)
zip.adb:270:29 (reference)
zip_streams.adb:162:34 (reference)
zip_streams.adb:169:36 (reference)
zip_streams.adb:176:35 (reference)
zip_streams.adb:182:51 (reference)
zip_streams.adb:190:52 (reference)
zip_streams.adb:197:47 (reference)
zip_streams.adb:203:41 (reference)
zip_streams.adb:205:42 (reference)
zip_streams.adb:207:51 (reference)
zip_streams.ads:126:30 (reference)
zip_streams.ads:131:34 (reference)
zip_streams.ads:135:36 (reference)
zip_streams.ads:138:35 (reference)
zip_streams.ads:212:9 (full declaration)
zip_streams.ads:218:28 (reference)
zip_streams.ads:225:28 (reference)
zip_streams.ads:229:48 (reference)
zip_streams.ads:232:43 (reference)
zip_streams.ads:235:42 (reference)
zip_streams.ads:238:51 (reference)
------------------------------------------ File_Zipstream : stream based on a file -- ------------------------------------------

Types

Time

type Time is private;
^ we define an own Time (Ada.Calendar's body can be very time - consuming!) See subpackage Calendar below for own Split, Time_Of and Convert from/to Ada.Calendar.Time.

Zipstream_Class

type Zipstream_Class is access all Root_Zipstream_Type'Class;

References:

zip_streams.ads:43:9 (declaration)
unzip-decompress.adb:8:66 (reference)
unzip-decompress.ads:21:40 (reference)
unzip-streams.adb:25:63 (reference)
unzip-streams.adb:42:36 (reference)
unzip-streams.adb:126:58 (reference)
unzip-streams.adb:191:23 (reference)
unzip-streams.adb:255:57 (reference)
unzip-streams.ads:39:44 (reference)
unzip.adb:16:65 (reference)
unzip.adb:194:36 (reference)
unzip.adb:458:32 (reference)
unzip.adb:507:32 (reference)
unzip.adb:553:32 (reference)
unzip.adb:640:23 (reference)
unzip.adb:695:23 (reference)
zip-headers.adb:69:44 (reference)
zip-headers.adb:101:31 (reference)
zip-headers.adb:132:43 (reference)
zip-headers.adb:158:30 (reference)
zip-headers.adb:203:44 (reference)
zip-headers.adb:222:34 (reference)
zip-headers.adb:284:31 (reference)
zip-headers.adb:321:50 (reference)
zip-headers.adb:331:37 (reference)
zip-headers.ads:44:50 (reference)
zip-headers.ads:49:36 (reference)
zip-headers.ads:71:42 (reference)
zip-headers.ads:76:29 (reference)
zip-headers.ads:106:42 (reference)
zip-headers.ads:111:29 (reference)
zip-headers.ads:145:43 (reference)
zip-headers.ads:152:33 (reference)
zip-headers.ads:155:31 (reference)
zip.adb:147:54 (reference)
zip.adb:271:30 (reference)
zip.adb:314:61 (reference)
zip.adb:435:67 (reference)
zip.adb:454:48 (reference)
zip.adb:478:61 (reference)
zip.adb:496:36 (reference)
zip.adb:615:57 (reference)
zip.adb:641:51 (reference)
zip.ads:69:54 (reference)
zip.ads:88:60 (reference)
zip.ads:169:67 (reference)
zip.ads:175:61 (reference)
zip.ads:229:57 (reference)
zip.ads:238:51 (reference)
zip.ads:311:36 (reference)
zip_streams.adb:28:44 (reference)
zip_streams.adb:35:27 (reference)
zip_streams.ads:81:29 (reference)
zip_streams.ads:84:28 (reference)
zip_streams.ads:97:28 (reference)
zip_streams.ads:100:27 (reference)

Unbounded_Stream

subtype Unbounded_Stream is Memory_Zipstream;

References:

zip_streams.ads:112:12 (declaration)
zip_streams.ads:113:24 (reference)

ZipFile_Stream

subtype ZipFile_Stream is File_Zipstream;

References:

zip_streams.ads:126:12 (declaration)
zip_streams.ads:127:24 (reference)

Constants & Global variables

some_time (private) (Time)

some_time : constant Time := 16789 * 65536;

References:

zip_streams.ads:174:4 (declaration)
zip_streams.ads:179:39 (reference)

Subprograms & Entries

Set_Index (abstract)

procedure Set_Index 
(S: access Root_Zipstream_Type;
To: Positive) is abstract;

References:

zip_streams.ads:46:14 (declaration)
unzip-decompress.adb:1973:28 (dispatching call)
unzip-streams.adb:40:22 (dispatching call)
unzip-streams.adb:84:22 (dispatching call)
unzip.adb:192:10 (dispatching call)
unzip.adb:298:13 (dispatching call)
zip-headers.adb:246:22 (dispatching call)
zip.adb:203:19 (dispatching call)
zip.adb:218:25 (dispatching call)
zip.adb:446:7 (dispatching call)
zip.adb:459:10 (dispatching call)
zip.adb:493:7 (dispatching call)
zip.adb:504:13 (dispatching call)
Set the index on the stream

Index (abstract)

function Index 
(S: access Root_Zipstream_Type) return Integer is abstract;

References:

zip_streams.ads:50:13 (declaration)
unzip-decompress.adb:1957:74 (dispatching call)
zip-headers.adb:262:40 (dispatching call)
zip.adb:220:79 (dispatching call)
zip.adb:459:27 (dispatching call)
zip.adb:504:30 (dispatching call)
zip.adb:635:83 (dispatching call)
returns the index of the stream

Size (abstract)

function Size 
(S: access Root_Zipstream_Type) return Integer is abstract;

References:

zip_streams.ads:53:13 (declaration)
zip-headers.adb:236:10 (dispatching call)
zip-headers.adb:239:56 (dispatching call)
zip-headers.adb:245:70 (dispatching call)
zip.adb:635:67 (dispatching call)
returns the Size of the stream

Set_Name

procedure Set_Name 
(S: access Root_Zipstream_Type;
Stream_Name: String);

References:

zip_streams.ads:56:14 (declaration)
unzip-streams.adb:202:10 (dispatching call)
unzip.adb:468:7 (dispatching call)
unzip.adb:516:7 (dispatching call)
unzip.adb:560:7 (dispatching call)
unzip.adb:645:10 (dispatching call)
unzip.adb:700:10 (dispatching call)
zip.adb:274:7 (dispatching call)
zip_streams.adb:12:14 (body)
zip_streams.adb:16:8 (label)
zip_streams.ads:58:85 (reference)

Calls:

To_Unbounded_String defined at a-strunb.ads:94:13
this procedure sets the name of the stream

SetName

procedure SetName 
(S: access Root_Zipstream_Type;
Stream_Name: String) renames Set_Name;

References:

zip_streams.ads:58:14 (declaration)
zip_streams.ads:59:24 (reference)

Get_Name

function Get_Name 
(S: access Root_Zipstream_Type) return String;

References:

zip_streams.ads:62:13 (declaration)
zip_streams.adb:18:13 (body)
zip_streams.ads:64:76 (reference)
this procedure returns the name of the stream

GetName

function GetName 
(S: access Root_Zipstream_Type) return String renames Get_Name;

References:

zip_streams.ads:64:13 (declaration)
zip_streams.ads:65:24 (reference)

Set_Unicode_Name_Flag

procedure Set_Unicode_Name_Flag 
(S: access Root_Zipstream_Type;
Value: Boolean);

References:

zip_streams.ads:67:14 (declaration)
zip_streams.adb:37:14 (body)
zip_streams.adb:42:8 (label)

Is_Unicode_Name

function Is_Unicode_Name 
(S: access Root_Zipstream_Type) return Boolean;

References:

zip_streams.ads:69:13 (declaration)
zip_streams.adb:44:13 (body)

Set_Time

procedure Set_Time 
(S: access Root_Zipstream_Type;
Modification_Time: Time);

References:

zip_streams.ads:73:14 (declaration)
zip_streams.adb:20:14 (body)
zip_streams.adb:24:8 (label)
zip_streams.adb:32:6 (dispatching call)
zip_streams.ads:77:58 (reference)

Called by:

Set_Time defined at zip_streams.ads:81:14
this procedure sets the Modification_Time of the stream

SetTime

procedure SetTime 
(S: access Root_Zipstream_Type;
Modification_Time: Time) renames Set_Time;

References:

zip_streams.ads:76:14 (declaration)
zip_streams.ads:78:24 (reference)

Set_Time

procedure Set_Time 
(S: Zipstream_Class;
Modification_Time: Ada.Calendar.Time);

References:

zip_streams.ads:81:14 (declaration)
zip_streams.adb:28:14 (body)
zip_streams.adb:33:8 (label)
zip_streams.ads:85:71 (reference)
same, with the standard Time type

SetTime

procedure SetTime 
(S: Zipstream_Class;
Modification_Time: Ada.Calendar.Time) renames Set_Time;

References:

zip_streams.ads:84:14 (declaration)
zip_streams.ads:86:24 (reference)

Get_Time

function Get_Time 
(S: access Root_Zipstream_Type) return Time;

References:

zip_streams.ads:89:13 (declaration)
zip_streams.adb:26:13 (body)
zip_streams.adb:35:91 (dispatching call)
zip_streams.ads:93:41 (reference)
this procedure returns the ModificationTime of the stream

GetTime

function GetTime 
(S: access Root_Zipstream_Type) return Time renames Get_Time;

References:

zip_streams.ads:92:13 (declaration)
zip_streams.ads:94:24 (reference)

Get_Time

function Get_Time 
(S: Zipstream_Class) return Ada.Calendar.Time;

References:

zip_streams.ads:97:13 (declaration)
zip_streams.adb:35:13 (body)
zip_streams.ads:101:54 (reference)
same, with the standard Time type

GetTime

function GetTime 
(S: Zipstream_Class) return Ada.Calendar.Time renames Get_Time;

References:

zip_streams.ads:100:13 (declaration)
zip_streams.ads:102:24 (reference)

End_Of_Stream (abstract)

function End_Of_Stream 
(S: access Root_Zipstream_Type) return Boolean is abstract;

References:

zip_streams.ads:105:13 (declaration)
zip.adb:632:13 (dispatching call)

Called by:

Zip.BlockRead defined at zip.ads:229:14
returns true if the index is at the end of the stream, else false

Get

procedure Get 
(Str: Memory_Zipstream;
Unb: out Unbounded_String);

References:

zip_streams.ads:116:14 (declaration)
zip_streams.adb:50:14 (body)
zip_streams.adb:54:8 (label)
Get the complete value of the stream

Set

procedure Set 
(Str: in out Memory_Zipstream;
Unb: Unbounded_String);

References:

zip_streams.ads:120:14 (declaration)
zip_streams.adb:56:14 (body)
zip_streams.adb:62:8 (label)
Set a value in the stream, the index will be set to null and old data in the stream will be lost.

Open

procedure Open 
(Str: in out File_Zipstream;
Zipfile_Mode: File_Mode);

Calls:

Open defined at a-ststio.ads:73:14
To_String defined at a-strunb.ads:100:13
Open the File_Zipstream PRE : Str.Name must be set

Create

procedure Create 
(Str: in out File_Zipstream;
Zipfile_Mode: File_Mode);

References:

zip_streams.ads:135:14 (declaration)
zip_streams.adb:169:14 (body)
zip_streams.adb:174:8 (label)

Calls:

Create defined at a-ststio.ads:67:14
To_String defined at a-strunb.ads:100:13
Creates a file on the disk PRE : Str.Name must be set

Read (private)

overriding procedure Read 
(Zip_Stream: in out Memory_Zipstream;
Item: out Stream_Element_Array;
Last: out Stream_Element_Offset);

References:

zip_streams.ads:190:25 (declaration)
zip_streams.adb:64:25 (body)
zip_streams.adb:87:8 (label)

Calls:

Element defined at a-strunb.ads:139:13
Read data from the stream.

Write (private)

overriding procedure Write 
(Zip_Stream: in out Memory_Zipstream;
Item: Stream_Element_Array);

References:

zip_streams.ads:196:25 (declaration)
zip_streams.adb:91:25 (body)
zip_streams.adb:125:8 (label)

Calls:

Append defined at a-strunb.ads:111:14
Length defined at a-strunb.ads:84:13
Replace_Element defined at a-strunb.ads:143:14
write data to the stream, starting from the current index. Data will be overwritten from index is already available.

Set_Index (private)

overriding procedure Set_Index 
(S: access Memory_Zipstream;
To: Positive);

References:

zip_streams.ads:200:25 (declaration)
zip_streams.adb:127:25 (body)
zip_streams.adb:142:8 (label)

Calls:

Append defined at a-strunb.ads:111:14
Length defined at a-strunb.ads:84:13
Set the index on the stream

Index (private)

overriding function Index 
(S: access Memory_Zipstream) return Integer;

References:

zip_streams.ads:203:24 (declaration)
zip_streams.adb:146:24 (body)
zip_streams.adb:151:21 (call)

Called by:

End_Of_Stream defined at zip_streams.ads:209:24
returns the index of the stream

Size (private)

overriding function Size 
(S: access Memory_Zipstream) return Integer;

References:

zip_streams.ads:206:24 (declaration)
zip_streams.adb:144:24 (body)
zip_streams.adb:151:10 (call)

Called by:

End_Of_Stream defined at zip_streams.ads:209:24
returns the Size of the stream

End_Of_Stream (private)

overriding function End_Of_Stream 
(S: access Memory_Zipstream) return Boolean;

References:

zip_streams.ads:209:24 (declaration)
zip_streams.adb:148:24 (body)
zip_streams.adb:156:8 (label)
returns true if the index is at the end of the stream

Read (private)

overriding procedure Read 
(Zip_Stream: in out File_Zipstream;
Item: out Stream_Element_Array;
Last: out Stream_Element_Offset);

References:

zip_streams.ads:217:25 (declaration)
zip_streams.adb:182:25 (body)
zip_streams.adb:188:8 (label)

Calls:

Read defined at a-ststio.ads:103:14
Read data from the stream.

Write (private)

overriding procedure Write 
(Zip_Stream: in out File_Zipstream;
Item: Stream_Element_Array);

References:

zip_streams.ads:224:25 (declaration)
zip_streams.adb:190:25 (body)
zip_streams.adb:195:8 (label)

Calls:

Write defined at a-ststio.ads:113:14
write data to the stream, starting from the current index. Data will be overwritten from index is already available.

Set_Index (private)

overriding procedure Set_Index 
(S: access File_Zipstream;
To: Positive);

References:

zip_streams.ads:229:25 (declaration)
zip_streams.adb:197:25 (body)
zip_streams.adb:201:8 (label)

Calls:

Set_Index defined at a-ststio.ads:121:14
Set the index on the stream

Index (private)

overriding function Index 
(S: access File_Zipstream) return Integer;

References:

zip_streams.ads:232:24 (declaration)
zip_streams.adb:205:24 (body)
returns the index of the stream

Size (private)

overriding function Size 
(S: access File_Zipstream) return Integer;

References:

zip_streams.ads:235:24 (declaration)
zip_streams.adb:203:24 (body)
returns the Size of the stream

End_Of_Stream (private)

overriding function End_Of_Stream 
(S: access File_Zipstream) return Boolean;

References:

zip_streams.ads:238:24 (declaration)
zip_streams.adb:207:24 (body)
returns true if the index is at the end of the stream