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

⟦43f02e4f3⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Misc_String_Utilities, seg_02ba40

Derivation

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

E3 Source Code



-- This package provides some string utilities which supplement
-- the ones in the Environment tools package "String_Utilities".
--
-- All strings are returned starting at index 1.
--
package Misc_String_Utilities is

    function Is_Blank (This_String : in String) return Boolean;
    --
    -- Returns True iff the specified string is null or contains only
    -- blanks and tabs.

    function Is_Continuous (This_String : in String) return Boolean;
    --
    -- Returns True iff the specified string contains no blanks or tabs.

    function Continuous (This_String : in String) return String;
    --
    -- Returns the string stripped of any blanks or tabs.

    function Is_Padded (This_String : in String) return Boolean;
    --
    -- Returns True iff the specified string has leading or trailing
    -- blanks or tabs.

    function Locate (This_Substring : in String;
                     Within_String : in String;
                     Ignore_Case : in Boolean;
                     Starting_At : in Positive := 1) return Natural;
    --
    -- Returns the index of the substring within the specified string, or
    -- returns 0.

    function Strip (Character_At : in Integer; In_String : in String)
                   return String;
    --
    -- Returns a string with the character at the specified location
    -- removed.

    function Stripped (This_String : in String;  
                       This_Character : in Character := ' ';
                       Ignore_Case : in Boolean := False;
                       Starting_At : in Positive := 1) return String;
    --
    -- Returns a string stripped of all characters which match the specified
    -- character. For instance, if the character is ' ':
    --
    --      "This string contains spaces" => "Thisstringcontainsspaces"
    --
    -- If "Ignore_Case" is True, both uppercase and lowercase characters
    -- which match the specified character will be stripped.

    function Strip (From_Here : in Integer;
                    To_Here : in Integer;
                    In_String : in String) return String;
    --
    -- Returns a string with the specified range removed. If the length
    -- of the range is < 0, has no effect.

    function Stripped (This_String : in String;  
                       This_Substring : in String;
                       Ignore_Case : in Boolean := False;
                       Starting_At : in Positive := 1) return String;
    --
    -- Returns a string stripped of all substrings which match the specified
    -- substring. For instance, if the substring is "in":
    --
    --      "This string contains spaces" => "This strg contas spaces"
    --
    -- If "Ignore_Case" is True, both uppercase and lowercase characters
    -- which match the characters in the specified substring will be stripped.

    function Replace (Character_At : in Integer;
                      With_Character : in Character;
                      In_String : in String) return String;
    --
    -- Returns a string with the character at the specified location in
    -- the string replaced with the specified character.

    function Replaced (This_String : in String;  
                       Old_Character : in Character := '_';
                       New_Character : in Character := ' ';
                       Ignore_Case : in Boolean := False;
                       Starting_At : in Positive := 1) return String;
    --
    -- Returns a string with every occurrence of "Old_Character" replaced
    -- by "New_Character". For instance, if the old character is ' ' and
    -- the new character is '_':
    --
    --      "This string contains spaces" => "This_string_contains_spaces"
    --
    -- If "Ignore_Case" is True, both uppercase and lowercase characters
    -- which match the specified old character will be replaced.

    function Replace (From_Here : in Integer;
                      To_Here : in Integer;
                      With_Substring : in String;
                      In_String : in String) return String;
    --
    -- Returns a string with the indicated range replaced with the specified
    -- substring. The length of the range can be less than, equal to, or
    -- greater than the length of the substring.
    --
    -- If the length of the range is < 0, the specified substring is inserted
    -- into the string starting at "From_Here", and no characters are removed
    -- from the existing string.

    function Replaced (This_String : in String;
                       Old_Substring : in String;
                       New_Substring : in String;
                       Ignore_Case : in Boolean := False;
                       Starting_At : in Positive := 1) return String;
    --
    -- Returns a string with every occurrence of "Old_Substring" replaced
    -- by "New_Substring" (the two substrings need not be the same length).
    -- For instance, it the old substring is "in" and the new substring
    -- is "out":
    --
    --      "This string contains spaces" => This stroutng contaouts spaces"
    --
    -- If "Ignore_Case" is True, both uppercase and lowercase characters
    -- which match the characters in the specified old substring will be
    -- replaced.

end Misc_String_Utilities;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=1d rec1=00 rec2=01 rec3=042
        [0x01] rec0=17 rec1=00 rec2=02 rec3=068
        [0x02] rec0=17 rec1=00 rec2=03 rec3=048
        [0x03] rec0=15 rec1=00 rec2=04 rec3=05a
        [0x04] rec0=14 rec1=00 rec2=05 rec3=082
        [0x05] rec0=0b rec1=00 rec2=06 rec3=000
    tail 0x21523ff6883f0790b4e0b 0x42a00088462060003