Package: International_Standard_Book_Numbers

Description

package International_Standard_Book_Numbers (spec)

International Standard Book Numbers.

Source: "Find fem fejl", Kjeld Bagger Laursen, in Hovedområdet 1/1998, Københavns Universitets Naturvidenskabelige Fakultet.

Update information:

1998.02.06 (Jacob Sparre Andersen) Written.

(Insert additional update information above this line.)

type ISBN:

Header

package International_Standard_Book_Numbers is

 

Type Summary

ISBN
Primitive Operations:  Image, Split, To_ISBN, Valid, Value

Other Items:

type ISBN is private;
function Valid:

Checks if an object of type ISBN has a valid value.

Exceptions: (none)


function Valid (Item : in ISBN) return Boolean;
function Image:

Converts an object of type ISBN to a string.

Exceptions: (none)


function Image (Item : in ISBN) return String;
function Value:

Converts a string to an object of type ISBN.

Exceptions: Constraint_Error - if the string does not represent a valid ISBN.


function Value (Item : in String) return ISBN;
function To_ISBN:

Composes an ISBN based on country, publisher, and book index.

Exceptions: Constraint_Error - if one of the indices are longer than there is space for.


function To_ISBN (Country, Publisher, Book         : in Natural;
                  Country_Length, Publisher_Length : in Positive)
  return ISBN;
procedure Split:

Extracts country, publisher, and book index from an ISBN.

Exceptions: (none)


procedure Split (Item      : in     ISBN;
                 Country   :    out Natural;
                 Publisher :    out Natural;
                 Book      :    out Natural);

private

   --  Implementation-defined ...

end International_Standard_Book_Numbers;