-- This package provides several useful utilities based on the catalog
-- structure abstraction.
--
-- No exceptions are handled by this package, and no exceptions are raised
-- by this package, so it is safe to assume that any exception which is
-- defined in the spec for "Structure" can propagate out of this package,
-- and that no exception which is not defined in the spec for "Structure"
-- will propagate out of this package.
--
with Subtypes;
use Subtypes;  
with Structure;
package Structure_Utilities is

    subtype Catalog is Structure.Catalog;

    function Catalog_For (This_Version : in Full_Name) return Catalog;
    --
    -- Attempts to resolve the Data_File for the specified catalog version
    -- and return the corresponding catalog structure.

    function Filtered_Catalog_From (This_Catalog : in Catalog) return Catalog;
    --
    -- Given a catalog, returns a catalog filtered to exclude sections
    -- of kind TEXT and items of kind ENVIRONMENT. The resulting catalog
    -- therefore contains only objects which have a physical realization
    -- on the Software Catalog tape.

    procedure Display_Diagnostic
                 (For_Catalog : in out Catalog;
                  Response : in String;
                  Display_Progress_Messages : in Boolean := False;
                  Display_Warning_Messages : in Boolean := False;
                  Display_Error_Messages : in Boolean := True);
    --
    -- Displays the diagnostic for the specified catalog, in accordance
    -- with the specified response parameter and Booleans.

    procedure Verify (This_Catalog : in out Structure.Catalog;
                      Response : in String);
    --
    -- Writes the specified catalog to a temporary file, then attempts
    -- to construct a temporary catalog from the file. This will reveal
    -- any errors hiding in the catalog.

end Structure_Utilities;