← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/feature-api-createDateTime into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/feature-api-createDateTime into lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Chris Hillery (ceejatec)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/feature-api-createDateTime/+merge/117976

new ItemFactory function that allows creating dateTime items without timezone

The function will be needed in the archive module (see separate merge proposal).
-- 
https://code.launchpad.net/~zorba-coders/zorba/feature-api-createDateTime/+merge/117976
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-07-27 02:49:06 +0000
+++ ChangeLog	2012-08-02 19:39:20 +0000
@@ -13,6 +13,7 @@
   * Added ft:tokenize-nodes() function to full-text module
   * New XQuery 3.0 functions
     - fn:parse-xml-fragment#1
+  * New ItemFactory function that allows creating dateTime items without timezone
   * Added support for transient maps to the
     http://www.zorba-xquery.com/modules/store/data-structures/unordered-map module.
   * Added support for fragments to fn:path

=== modified file 'include/zorba/item_factory.h'
--- include/zorba/item_factory.h	2012-07-24 08:48:48 +0000
+++ include/zorba/item_factory.h	2012-08-02 19:39:20 +0000
@@ -295,6 +295,21 @@
                      short aHour, short aMinute, double aSecond,
                      short aTimeZone_hours) = 0;
 
+      /** \brief Creates a DateTime Item without setting a time zone.
+       *         see [http://www.w3.org/TR/xmlschema-2/#dateTime]
+       *
+       * @param aYear short-valued representation of the year.
+       * @param aMonth short-valued representation of the month.
+       * @param aDay short-valued representation of the day.
+       * @param aHour short-valued representation of the hour.
+       * @param aMinute short-valued representation of the minute.
+       * @param aSecond double-valued representation of the seconds and fractional seconds.
+       * @return The DateTime Item.
+       */
+      virtual Item
+      createDateTime(short aYear, short aMonth, short aDay,
+                     short aHour, short aMinute, double aSecond) = 0;
+
       /** \brief Creates a DateTime Item
        *         see [http://www.w3.org/TR/xmlschema-2/#dateTime]
        *

=== modified file 'src/api/itemfactoryimpl.cpp'
--- src/api/itemfactoryimpl.cpp	2012-07-24 08:48:48 +0000
+++ src/api/itemfactoryimpl.cpp	2012-08-02 19:39:20 +0000
@@ -366,6 +366,20 @@
 }
 
 
+Item
+ItemFactoryImpl::createDateTime(
+    short aYear, short aMonth, short aDay,
+    short aHour, short aMinute, double aSecond)
+{
+  store::Item_t lItem;
+  theItemFactory->createDateTime(
+      lItem, aYear, aMonth, aDay,
+      aHour, aMinute, aSecond);
+
+  return &*lItem;
+}
+
+
 Item ItemFactoryImpl::createDateTime( const String& aDateTimeValue )
 {
   zstring lString = Unmarshaller::getInternalString( aDateTimeValue );

=== modified file 'src/api/itemfactoryimpl.h'
--- src/api/itemfactoryimpl.h	2012-07-24 08:48:48 +0000
+++ src/api/itemfactoryimpl.h	2012-08-02 19:39:20 +0000
@@ -118,6 +118,10 @@
                      short aTimezone_hours);
 
       virtual Item
+      createDateTime(short aYear, short aMonth, short aDay,
+                     short aHour, short aMinute, double aSecond);
+
+      virtual Item
       createDateTime( const String& aDateTimeValue );
 
       virtual Item


Follow ups