Go to file
Anthony Arnold 8b92cc5369 Added documentation generated with AdaBrowse. When changing an interface, must run 'make docs' before commiting. 2012-01-20 11:20:42 +10:00
ali Split some unit tests up to test more distinct functionality. Added new unit test to check that Invalid_String is thrown in From_Name. Fixed up some ignore files. 2012-01-17 13:26:45 +10:00
bin Split some unit tests up to test more distinct functionality. Added new unit test to check that Invalid_String is thrown in From_Name. Fixed up some ignore files. 2012-01-17 13:26:45 +10:00
doc Added documentation generated with AdaBrowse. When changing an interface, must run 'make docs' before commiting. 2012-01-20 11:20:42 +10:00
include Added documentation generated with AdaBrowse. When changing an interface, must run 'make docs' before commiting. 2012-01-20 11:20:42 +10:00
lib Added documentation generated with AdaBrowse. When changing an interface, must run 'make docs' before commiting. 2012-01-20 11:20:42 +10:00
obj Split some unit tests up to test more distinct functionality. Added new unit test to check that Invalid_String is thrown in From_Name. Fixed up some ignore files. 2012-01-17 13:26:45 +10:00
src Getting random seed from /dev/urandom, and falling back to time-based seed 2012-01-17 20:44:27 +10:00
support Can now make install. 2012-01-17 17:10:23 +10:00
test Can now make install. 2012-01-17 17:10:23 +10:00
.gitignore Can now make install. 2012-01-17 17:10:23 +10:00
LICENSE Added README and LICENSE files. Getting ready to go to github 2012-01-16 00:19:51 +10:00
Makefile Added documentation generated with AdaBrowse. When changing an interface, must run 'make docs' before commiting. 2012-01-20 11:20:42 +10:00
README.md Remove -gnat12 switched; not needed. Updated README.md to reflect changes. 2012-01-17 22:21:15 +10:00
adaid.gpr.in Remove -gnat12 switched; not needed. Updated README.md to reflect changes. 2012-01-17 22:21:15 +10:00
adaid_debug.gpr Remove -gnat12 switched; not needed. Updated README.md to reflect changes. 2012-01-17 22:21:15 +10:00
test.gpr Remove -gnat12 switched; not needed. Updated README.md to reflect changes. 2012-01-17 22:21:15 +10:00

README.md

#AdaID#

What is it? AdaID is a simple Ada library for generating UUIDs. Supported operations include:

  • Generating random UUIDs
  • Generating name-based UUIDs
  • Restoring UUIDs from a string representation.
  • Converting a UUID to a string

What are the dependencies? There are a couple of tools that you'll need to build and install AdaID. Firstly, you should have make installed, like every good programmer. Secondly, it's assumed that you're using GNAT, or you at least have a recent version available. If you don't have GNAT available, you will need to make your own build scripts (nudge, wink to contributers).

If you want to run the unit test suite, you'll need AUnit installed. If you don't have it, and you don't care about running the tests (and you should), then just avoid running make test.

How do I build it? To build the library: run make, optionally followed by make test, and finally make install. The library should now be installed on your system.

OK, how is it used? Here's an example usage:

-- file: print_random_uuid.adb
with AdaID; use AdaID;
with Ada.Text_IO; use Ada.Text_IO;
procedure Print_Random_UUID is
	id : UUID;
begin
	Random(id);
	Put_Line(To_String(id));
end Print_Random_UUID;

To compile, create a gnat project file to build the example:

with "adaid.gpr";
project Print_Random_UUID is
	for Main use ("print_random_uuid.adb");
	for Languages use ("Ada");
end Print_Random_UUID;

And build:

gnatmake -Pprint_random_uuid.gpr

What's next? Future improvements include:

  • General make file improvements
  • Library documentation