git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] mbeckerle commented on a change in pull request #70: Adding property binaryCalendarRep with values "binarySeconds" and "bi…


mbeckerle commented on a change in pull request #70: Adding property binaryCalendarRep with values "binarySeconds" and "bi…
URL: https://github.com/apache/incubator-daffodil/pull/70#discussion_r189971598
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
 ##########
 @@ -775,6 +782,25 @@ trait ElementBaseGrammarMixin
       }
 
       case PrimType.Boolean => { new BinaryBoolean(this) }
+
+      case PrimType.DateTime | PrimType.Date | PrimType.Time => {
+        (primType, binaryCalendarRep) match {
+          case (PrimType.DateTime, BinaryCalendarRep.BinarySeconds) => (lengthUnits, binaryNumberKnownLengthInBits) match {
+            case (LengthUnits.Bytes, 32) => new ConvertBinaryDateTimePrim(this, binaryNumberKnownLengthInBits)
 
 Review comment:
   Yes, these restrictions on lengthUnits turned out to be a bad idea ultimately. They require a special check, and add no value over just requiring the length to ultimately be exactly 32 or 64 bits regardless of units used to express that. When a data format expresses *everything* in units of bits, these restrictions just make it awkward to shift to bytes units for these few cases. 
   
   But the DFDL spec does require the check.... unfortunately. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services