TABLE OF CONTENTS


Yass/AtomFeed [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code to create Atom feed

SOURCE

package AtomFeed is

AtomFeed/AtomFeed.Feed_Entry [ Types ]

[ Top ] [ AtomFeed ] [ Types ]

FUNCTION

 Data structure for Atom entries

SOURCE

   type Feed_Entry is record
      Id: Unbounded_String;
      Entry_Title: Unbounded_String;
      Updated: Time := Clock;
      Author_Name: Unbounded_String;
      Author_Email: Unbounded_String;
      Summary: Unbounded_String;
      Content: Unbounded_String;
   end record;

PARAMETERS

 Id           - Url of entry
 Entry_Title  - Title of entry
 Updated      - Update time of entry
 Author_Name  - Name of author of entry
 Author_Email - Email of author of entry
 Summary      - Short summary of entry
 Content      - Content of entry

AtomFeed/AtomFeed.FeedEntry_Container [ Types ]

[ Top ] [ AtomFeed ] [ Types ]

FUNCTION

 Used to store Atom feed entries

SOURCE

   package FeedEntry_Container is new Vectors
     (Index_Type => Positive, Element_Type => Feed_Entry);

AtomFeed/AtomFeed.Empty_Feed_Entry [ Constants ]

[ Top ] [ AtomFeed ] [ Constants ]

FUNCTION

 Empty Atom feed entry

SOURCE

   Empty_Feed_Entry: constant Feed_Entry := (others => <>);

AtomFeed/AtomFeed.Add_Page_To_Feed [ Subprograms ]

[ Top ] [ AtomFeed ] [ Subprograms ]

FUNCTION

 Add page with full path File_Name and it extracted Atom entries Entries to the site Atom feed

SOURCE

   procedure Add_Page_To_Feed
     (File_Name: String; Entries: in out FeedEntry_Container.Vector) with
      Pre => File_Name'Length > 0,
      Test_Case => (Name => "Test_Add_Page_To_Feed", Mode => Nominal);

PARAMETERS

 File_Name - File name of the page to add
 Entries   - List of Atom feed entries

AtomFeed/AtomFeed.Save_Atom_Feed [ Subprograms ]

[ Top ] [ AtomFeed ] [ Subprograms ]

FUNCTION

 Save Atom feed to file

SOURCE

   procedure Save_Atom_Feed with
      Test_Case => (Name => "Test_Save_Atom_Feed", Mode => Robustness);

AtomFeed/AtomFeed.Start_Atom_Feed [ Subprograms ]

[ Top ] [ AtomFeed ] [ Subprograms ]

FUNCTION

 Load existing Atom feed for the site

SOURCE

   procedure Start_Atom_Feed with
      Test_Case => (Name => "Test_Start_Atom_Feed", Mode => Robustness);

AtomFeed/AtomFeed.To_HTTP_Date [ Subprograms ]

[ Top ] [ AtomFeed ] [ Subprograms ]

FUNCTION

 Convert Ada Time to HTTP date format

SOURCE

   function To_HTTP_Date span class="sign">## rule line off NAMING_CONVENTION
     (Date: Time) return String with
      Post => To_HTTP_Date'Result'Length > 0,
      Test_Case => (Name => "Test_To_HTTP_Date", Mode => Nominal);

PARAMETERS

 Date - Ada Time to convert

RESULT

 Converted Ada Time to HTTP date format

AtomFeed/AtomFeed.To_Time [ Subprograms ]

[ Top ] [ AtomFeed ] [ Subprograms ]

FUNCTION

 Convert HTTP date to Ada format

SOURCE

   function To_Time(Date: String) return Time with
      Pre => Date'Length > 0,
      Test_Case => (Name => "Test_To_Date", Mode => Nominal);

PARAMETERS

 Date - HTTP date to convert

RESULT

 Converted HTTP date to Ada Time