diff options
author | Martin Jambor <mjambor@suse.cz> | 2016-07-12 16:42:57 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2016-07-12 16:42:57 +0000 |
commit | 28b8dcee563068144d128dd80f632a76eadf166e (patch) | |
tree | 08a2ad27918bdea8c42cff29e35d1d6ba2bf142f /gcc/ada/g-forstr.ads | |
parent | ab9b316a08275b1c14ea16dfc07d712bd2418124 (diff) |
Merged trunk revision 238207 into the hsa branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/hsa@238255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-forstr.ads')
-rw-r--r-- | gcc/ada/g-forstr.ads | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/ada/g-forstr.ads b/gcc/ada/g-forstr.ads index 94c295c7251..88856a35b3a 100644 --- a/gcc/ada/g-forstr.ads +++ b/gcc/ada/g-forstr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2014-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -29,10 +29,22 @@ -- -- ------------------------------------------------------------------------------ --- This package add support for formatted string as supported by C printf(). +-- This package add support for formatted string as supported by C printf() -- A simple usage is: - +-- +-- Put_Line (-(+"%s" & "a string")); +-- +-- or with a constant for the format: +-- +-- declare +-- Format : constant Formatted_String := +"%s"; +-- begin +-- Put_Line (-(Format & "a string")); +-- end; +-- +-- Finally a more complex example: +-- -- declare -- F : Formatted_String := +"['%c' ; %10d]"; -- C : Character := 'v'; @@ -132,7 +144,12 @@ package GNAT.Formatted_String is use Ada; type Formatted_String (<>) is private; - -- A format string as defined for printf routine + -- A format string as defined for printf routine. This string is the + -- actual format for all the parameters added with the "&" routines below. + -- Note that a Formatted_String object can't be reused as it serves as + -- recipient for the final result. That is, each use of "&" will build + -- incrementally the final result string which can be retrieved with + -- the "-" routine below. Format_Error : exception; -- Raised for every mismatch between the parameter and the expected format |