From: Arjen Baart Date: Sat, 6 Jul 2019 07:25:28 +0000 (+0200) Subject: Added documentation for class hour. X-Git-Tag: v0.2~9 X-Git-Url: http://www.andromeda.nl/gitweb/?a=commitdiff_plain;h=749c624c0643224588dc9e213be6c0774070e45d;p=libacl.git Added documentation for class hour. --- diff --git a/doc/Makefile.am b/doc/Makefile.am index e3e9399..200bf0c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,7 +7,7 @@ SUFFIXES = .obj .eps .png .obj.eps: tgif -print -eps -color $< -XMLS = manual.xml string.xml date.xml +XMLS = manual.xml string.xml date.xml hour.xml IMAGES= PICTURES= diff --git a/doc/date.xml b/doc/date.xml index 40d038d..50a9579 100644 --- a/doc/date.xml +++ b/doc/date.xml @@ -7,11 +7,36 @@ date d; -The date class encapsulates the concept of a calender date. It holds +The date class encapsulates the concept of a date, represented by +days, months and years. It holds a day and a month, both between 0 and 255, and a year ranging from -32768 to +32767. Although full-range dates can be usefull in calulations, a real date should have a day between 1 and 31 inclusive, and a month between 1 and 12. +Only such dates can be used as proper calender dates. +A different kind of date may be used as a relative date to perform calculations. +For example, to add 2 years, 3 months and 6 days to a date, a date like (6, 3, 2) can be created. All calculations with dates are based on the Julian calendar. + + +Parsing text into a date object is a challenging task. +Partly because there are many ways to write dates but also because some +ways to write a date are ambiguous. +For example, the date 8-2-12 could mean August 2nd 2012, 12th of February 2008 +or 8th of February 2012. +These are some ways to write February 8th 2012 that are supported by the parser: + +20120208 +2012-02-08 +2012 02 08 +08-02-2012 +02/08/2012 +Feb 8 2012 +2012 Feb 8 +8 FEB 2012 +2012 8 feb +8 February 2012 + +
@@ -21,8 +46,11 @@ All calculations with dates are based on the Julian calendar. The default constructor sets all elements (day, month and year) to 0. +Constructs a date object with the specified year, month and day. +For this date object to be a proper calendar date, the month must be between +1 and 12 an the day myst be between 1 and the number of days in that month. - + @@ -34,7 +62,8 @@ The default constructor sets all elements (day, month and year) to 0. - + +Parse string s and extract a day, month and year if the string contains an actual date.
@@ -55,6 +84,9 @@ Converts a date to an ASCII format.
Relational operations + +The relational operators are defined with obvious meanings: + @@ -96,11 +128,16 @@ Returns the number of days in this month, or zero if the month is not between 1 and 12. +Calculate the day of the week, where 1 is Monday and 7 is Sunday. +If the date is not a proper calendar date, return 0. + +Calculate the number of the week within the year. +
@@ -109,10 +146,14 @@ between 1 and 12. Arithmetic +Add a number of days, months and years to a date. +This is most usefull if one of the dates is a proper calendar date +and the other is not. +Add a number of days to a date. diff --git a/doc/hour.xml b/doc/hour.xml new file mode 100644 index 0000000..e1c4cd1 --- /dev/null +++ b/doc/hour.xml @@ -0,0 +1,130 @@ + + + + hour - Time class +
+#include <date.h>
+
+hour t;
+
+ +The hour class encapsulates a time in hours, minutes and seconds. +Most operators are defined to provide calculations just like integer numbers. + + +
+Construction and assigment + + +Objects of class hour can be constructed and assigned from integer numbers, +String objects or other hour objects. + + + + + +A number of seconds. + + + + + +Format is HH:MM:SS + + + + + + + + + + + +
+ +
+Conversion + + + + +Converts to a number of seconds. + + + + + + +
+
+Relational operations + + + + + + + + + + + + + + + + +
+
+Attributes + + + + + + + + + + +
+
+Arithmetic + + + + + + + + + + + + + + + + +
+
+Stream I/O + + + + + + + + +
+
+ SEE ALSO + +date +UTC + + +
+
diff --git a/doc/manual.xml b/doc/manual.xml index a1020ab..d1ce759 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -9,5 +9,7 @@ xmlns:xi="http://www.w3.org/2001/XInclude"/> +