Skip to content

Commit

Permalink
Add some documentation :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blady-Com committed Feb 26, 2021
1 parent b43b464 commit 2bee0ab
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/uxstrings-conversions.ads
@@ -1,38 +1,48 @@
package UXStrings.Conversions is

subtype Number_Base is Integer range 2 .. 16;
-- Range of possible numerical base on integer values and images
type Number_Prefix is (None, ' ', '+');
-- List of possible prefix on integer images

generic
type T is (<>);
function Scalar_Value (Item : UXString) return T;
-- Return the conversion of the string Item into scalar value

generic
type T is range <>;
function Integer_Value (Item : UXString; Base : in Number_Base := 10) return T;
-- Return the conversion of the string Item into integer value with respect of specified Base

generic
type T is digits <>;
function Floating_Point_Value (Item : UXString) return T;
-- Return the conversion of the string Item into floating point value

generic
type T is delta <>;
function Fixed_Point_Value (Item : UXString) return T;
-- Return the conversion of the string Item into fixed point value

generic
type T is (<>);
function Scalar_Image (Item : T) return UXString;
-- Return the conversion of the scalar Item into string

generic
type T is range <>;
function Integer_Image (Item : T; Base : in Number_Base := 10; Prefix : Number_Prefix := None) return UXString;
-- Return the conversion of the integer Item into string with respect of specified Base and Prefix

generic
type T is digits <>;
function Floating_Point_Image (Item : T) return UXString;
-- Return the conversion of the floating point Item into string

generic
type T is delta <>;
function Fixed_Point_Image (Item : T) return UXString;
-- Return the conversion of the fixed point Item into string

end UXStrings.Conversions;
4 changes: 4 additions & 0 deletions src/uxstrings-formatting.ads
Expand Up @@ -3,12 +3,16 @@ with Ada.Strings;
package UXStrings.Formatting is

subtype Number_Base is Integer range 2 .. 16;
-- Range of possible numerical base on integer values
subtype Alignment is Ada.Strings.Alignment;
-- List of possible alignment of integer values

generic
type T is range <>;
function Integer_Format
(Item : T; Base : in Number_Base := 10; Put_Plus : in Boolean := False; Field : in Natural := 0;
Justify : in Alignment := Left; Fill : in Character := ' ') return UXString;
-- Return the formatted string of the integer Item with respect of specified Base, Put_Plus sign,
-- output Field size, alignment Justify, padding Fill

end UXStrings.Formatting;
3 changes: 3 additions & 0 deletions src/uxstrings-hash.ads
@@ -1,3 +1,6 @@
with Ada.Containers;

function UXStrings.Hash (Key : UXString) return Ada.Containers.Hash_Type;
-- Return an implementation-defined value which is a function of the value of Key.
-- If A and B are strings such that A equals B then Hash(A) equals Hash(B).

1 change: 1 addition & 0 deletions src/uxstrings-text_io-text_streams.ads
Expand Up @@ -4,6 +4,7 @@ package UXStrings.Text_IO.Text_Streams is
type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;

function Stream (File : File_Type) return Stream_Access;
-- Return an stream access to File

private

Expand Down

0 comments on commit 2bee0ab

Please sign in to comment.