Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.