DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦d75806d6a⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Lines, seg_0046da

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



package body Lines is

    procedure Assert_Is_Initialized (This_Line : in Line) is
    begin
        if not This_Line.Is_Initialized then
            raise Not_Initialized;
        end if;
    end Assert_Is_Initialized;

    procedure Assert_Is_Initialized (This_Iterator : in Iterator) is
    begin
        if not This_Iterator.Is_Initialized then
            raise Not_Initialized;
        end if;
    end Assert_Is_Initialized;

    function Create (From_String : in String) return Line is

        New_Line : Line;

    begin
        Vstrings.Copy (New_Line.Contents, From_String);
        New_Line.Is_Initialized := True;
        return New_Line;
    end Create;

    function Empty_Line return Line is
    begin
        return Lines.Create ("");
    end Empty_Line;

    function Copy (Of_Line : in Line) return Line is
    begin
        return Lines.Create (Lines.Image (Of_Line));
    end Copy;

    function Image (Of_Line : in Line) return String is
    begin
        Assert_Is_Initialized (Of_Line);
        return Vstrings.Image (Of_Line.Contents);
    end Image;

    function Create return Iterator is

        New_Iterator : Iterator;

    begin  
        New_Iterator.Is_Initialized := True;
        return New_Iterator;
    end Create;

    function Is_Empty (This_Iterator : in Iterator) return Boolean is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.Is_Empty (This_Iterator.Contents);
    end Is_Empty;

    function Lines_In (This_Iterator : in Iterator) return Natural is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.Elements_In (This_Iterator.Contents);
    end Lines_In;

    function Copy_Lines is new Strings.Copy (Copy);

    function Copy (Of_Iterator : in Iterator) return Iterator is

        New_Iterator : Iterator;

    begin
        New_Iterator.Contents       := Copy_Lines (Of_Iterator.Contents);
        New_Iterator.Is_Initialized := True;
        return New_Iterator;
    end Copy;

    procedure Reset_To_First (This_Iterator : in out Iterator) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Strings.Reset_To_First (This_Iterator.Contents);
    end Reset_To_First;

    procedure Reset_To_Last (This_Iterator : in out Iterator) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Strings.Reset_To_Last (This_Iterator.Contents);
    end Reset_To_Last;

    function Done (This_Iterator : in Iterator) return Boolean is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.Done (This_Iterator.Contents);
    end Done;

    function At_First (This_Iterator : in Iterator) return Boolean is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.At_First (This_Iterator.Contents);
    end At_First;

    function At_Last (This_Iterator : in Iterator) return Boolean is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.At_Last (This_Iterator.Contents);
    end At_Last;

    procedure Previous (This_Iterator : in out Iterator) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Strings.Previous (This_Iterator.Contents);

    exception
        when Strings.No_Previous_Element =>
            raise No_Previous_Line;

    end Previous;

    procedure Next (This_Iterator : in out Iterator) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Strings.Next (This_Iterator.Contents);

    exception
        when Strings.No_Next_Element =>
            raise No_Next_Line;

    end Next;

    function Current (This_Iterator : in Iterator) return Line is
    begin  
        Assert_Is_Initialized (This_Iterator);
        return Strings.Current (This_Iterator.Contents);

    exception
        when Strings.No_Current_Element =>
            raise No_Current_Line;

    end Current;

    function Position (In_Iterator : in Iterator) return Line_Number is
    begin  
        Assert_Is_Initialized (In_Iterator);
        return Line_Number (Strings.Position (In_Iterator.Contents));

    exception
        when Strings.No_Current_Element =>
            raise No_Current_Line;

    end Position;

    procedure Set (This_Iterator : in out Iterator; To_Line : in Line_Number) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Strings.Set (This_Iterator.Contents, Strings.Positions (To_Line));

    exception
        when Strings.Out_Of_Range =>
            raise Out_Of_Range;

    end Set;

    function Line_At (This_Position : in Line_Number; In_Iterator : in Iterator)
                     return Line is
    begin  
        Assert_Is_Initialized (In_Iterator);
        return Strings.Element_At
                  (Strings.Positions (This_Position), In_Iterator.Contents);
    exception
        when Strings.Out_Of_Range =>
            raise Out_Of_Range;

    end Line_At;

    procedure Add (To_Iterator : in out Iterator; This_Line : in Line) is
    begin
        Assert_Is_Initialized (To_Iterator);
        Assert_Is_Initialized (This_Line);
        Strings.Add (To_Iterator.Contents, This_Line);
    end Add;

    procedure Add (To_Iterator      : in out Iterator;
                   This_Line        : in     Line;
                   With_Orientation : in     Orientations) is
    begin
        Assert_Is_Initialized (To_Iterator);
        Assert_Is_Initialized (This_Line);
        case With_Orientation is
            when Preceeding =>
                Strings.Add (To_Iterator.Contents,
                             This_Line, Strings.Preceeding);
            when Following =>
                Strings.Add (To_Iterator.Contents,
                             This_Line, Strings.Following);
        end case;

    exception
        when Strings.No_Current_Element =>
            raise No_Current_Line;

    end Add;

    procedure Add (To_Iterator      : in out Iterator;
                   This_Line        : in     Line;
                   At_Position      : in     Line_Number;
                   With_Orientation : in     Orientations) is
    begin
        Assert_Is_Initialized (To_Iterator);
        Assert_Is_Initialized (This_Line);
        case With_Orientation is
            when Preceeding =>
                Strings.Add (To_Iterator.Contents, This_Line,
                             Strings.Positions (At_Position),
                             Strings.Preceeding);
            when Following =>
                Strings.Add (To_Iterator.Contents, This_Line,
                             Strings.Positions (At_Position),
                             Strings.Following);
        end case;

    exception
        when Strings.Out_Of_Range =>
            raise Out_Of_Range;

    end Add;

    procedure Modify (This_Iterator : in out Iterator; New_Line : in Line) is
    begin  
        Assert_Is_Initialized (This_Iterator);
        Assert_Is_Initialized (New_Line);
        Strings.Modify (This_Iterator.Contents, New_Line);

    exception
        when Strings.No_Current_Element =>
            raise No_Current_Line;

    end Modify;

    procedure Delete (From_Iterator : in out Iterator) is
    begin  
        Assert_Is_Initialized (From_Iterator);
        Strings.Delete (From_Iterator.Contents);

    exception
        when Strings.No_Current_Element =>
            raise No_Current_Line;

    end Delete;

    procedure Delete (From_Iterator : in out Iterator;
                      This_Position : in     Line_Number) is
    begin  
        Assert_Is_Initialized (From_Iterator);
        Strings.Delete (From_Iterator.Contents,
                        Strings.Positions (This_Position));
    exception
        when Strings.Out_Of_Range =>
            raise Out_Of_Range;

    end Delete;

    procedure Dispose (Of_This_Iterator : in out Iterator) is
    begin
        Strings.Dispose (Strings.List (Of_This_Iterator.Contents));
    end Dispose;

end Lines;

E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=26 rec1=00 rec2=01 rec3=04a
        [0x01] rec0=22 rec1=00 rec2=02 rec3=074
        [0x02] rec0=00 rec1=00 rec2=0a rec3=00c
        [0x03] rec0=1d rec1=00 rec2=03 rec3=062
        [0x04] rec0=23 rec1=00 rec2=04 rec3=006
        [0x05] rec0=1f rec1=00 rec2=05 rec3=08c
        [0x06] rec0=1d rec1=00 rec2=06 rec3=00e
        [0x07] rec0=1a rec1=00 rec2=07 rec3=03c
        [0x08] rec0=22 rec1=00 rec2=08 rec3=012
        [0x09] rec0=0b rec1=00 rec2=09 rec3=000
    tail 0x217002a38815c6730397f 0x42a00088462061e03