OSDN Git Service

More improvements to sparc VIS vec_init code generation.
[pf3gnuchains/gcc-fork.git] / gcc / ada / g-catiio.ads
index 9f3188c..523b597 100644 (file)
@@ -6,29 +6,23 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---            Copyright (C) 1999-2001 Ada Core Technologies, Inc.           --
---                                                                          --
--- This specification is derived from the Ada Reference Manual for use with --
--- GNAT. The copyright notice above, and the license provisions that follow --
--- apply solely to the  contents of the part following the private keyword. --
+--                     Copyright (C) 1999-2010, AdaCore                     --
 --                                                                          --
 -- 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- --
--- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
--- for  more details.  You should have  received  a copy of the GNU General --
--- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
+--                                                                          --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception,   --
+-- version 3.1, as published by the Free Software Foundation.               --
 --                                                                          --
--- As a special exception,  if other files  instantiate  generics from this --
--- unit, or you link  this unit with other files  to produce an executable, --
--- this  unit  does not  by itself cause  the resulting  executable  to  be --
--- covered  by the  GNU  General  Public  License.  This exception does not --
--- however invalidate  any other reasons why  the executable file  might be --
--- covered by the  GNU Public License.                                      --
+-- You should have received a copy of the GNU General Public License and    --
+-- a copy of the GCC Runtime Library Exception along with this program;     --
+-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
+-- <http://www.gnu.org/licenses/>.                                          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
@@ -41,9 +35,9 @@
 package GNAT.Calendar.Time_IO is
 
    Picture_Error : exception;
+   --  Exception raised for incorrect picture
 
    type Picture_String is new String;
-
    --  This is a string to describe date and time output format. The string is
    --  a set of standard character and special tag that are replaced by the
    --  corresponding values. It follows the GNU Date specification. Here are
@@ -95,12 +89,18 @@ package GNAT.Calendar.Time_IO is
    --
    --          -    (hyphen) do not pad the field
    --          _    (underscore) pad the field with spaces
+   --
+   --  Here are some GNAT extensions to the GNU Date specification:
+   --
+   --          %i   milliseconds (3 digits)
+   --          %e   microseconds (6 digits)
+   --          %o   nanoseconds  (9 digits)
 
-   ISO_Date      : constant Picture_String;
+   ISO_Date : constant Picture_String;
    --  This format follow the ISO 8601 standard. The format is "YYYY-MM-DD",
    --  four digits year, month and day number separated by minus.
 
-   US_Date       : constant Picture_String;
+   US_Date : constant Picture_String;
    --  This format is the common US date format: "MM/DD/YY",
    --  month and day number, two digits year separated by slashes.
 
@@ -110,16 +110,41 @@ package GNAT.Calendar.Time_IO is
 
    function Image
      (Date    : Ada.Calendar.Time;
-      Picture : Picture_String)
-      return    String;
-   --  Return Date as a string with format Picture.
-   --  raise Picture_Error if picture string is wrong
+      Picture : Picture_String) return String;
+   --  Return Date as a string with format Picture. Raise Picture_Error if
+   --  picture string is null or has an incorrect format.
 
-   procedure Put_Time
-     (Date    : Ada.Calendar.Time;
-      Picture : Picture_String);
-   --  Put Date with format Picture.
-   --  raise Picture_Error if picture string is wrong
+   function Value (Date : String) return Ada.Calendar.Time;
+   --  Parse the string Date and return its equivalent as a Time value. The
+   --  following time format is supported:
+   --
+   --     hh:mm:ss             - Date is the current date
+   --
+   --  The following formats are also supported. They all accept an optional
+   --  time with the format "hh:mm:ss". The time is separated from the date by
+   --  exactly one space character.
+   --
+   --  When the time is not specified, it is set to 00:00:00. The delimiter '*'
+   --  must be either '-' and '/' and both occurrences must use the same
+   --  character.
+   --
+   --  Trailing characters (in particular spaces) are not allowed
+   --
+   --     yyyy*mm*dd           - ISO format
+   --     yy*mm*dd             - Year is assumed to be 20yy
+   --     mm*dd*yyyy           - (US date format)
+   --     dd*mmm*yyyy          - month spelled out
+   --     yyyy*mmm*dd          - month spelled out
+   --     yyyymmdd             - Iso format, no separator
+   --     mmm dd, yyyy         - month spelled out
+   --     dd mmm yyyy          - month spelled out
+   --
+   --  Constraint_Error is raised if the input string is malformed (does not
+   --  conform to one of the above dates, or has an invalid time string), or
+   --  the resulting time is not valid.
+
+   procedure Put_Time (Date : Ada.Calendar.Time; Picture : Picture_String);
+   --  Put Date with format Picture. Raise Picture_Error if bad picture string
 
 private
    ISO_Date      : constant Picture_String := "%Y-%m-%d";