mbeckerle commented on code in PR #1165:
URL: https://github.com/apache/daffodil/pull/1165#discussion_r1501154549


##########
daffodil-runtime1-layers/src/main/scala/org/apache/daffodil/layers/runtime1/Base64MimeLayer.scala:
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.daffodil.layers.runtime1
+
+import java.io.InputStream
+import java.io.OutputStream
+import java.util.Optional
+import scala.collection.JavaConverters._
+
+import org.apache.daffodil.runtime1.layers.api.JLayerLengthKind
+import org.apache.daffodil.runtime1.layers.api.Layer
+import org.apache.daffodil.runtime1.layers.api.LayerRuntime
+
+final class Base64MimeLayer
+  extends Layer(
+    layerName = "base64_MIME",
+    supportedLayerLengthKinds = Seq(JLayerLengthKind.BoundaryMark).asJava,

Review Comment:
   Hmmm. Perhaps. 
   
   One thing I did is make it so layers mostly don't have to deal with length 
limiting. They just declare whether they want implicit, explicit, or 
boundaryMark, and the system does the rest. That said, Some of the layers 
needed more than this. Line folding specifically. 
   
   This idea that the ideas can be decoupled is kind of interesting. 
boundaryMark is a kind of delimited behavior which (1) can be used on sequences 
(not elements like regular dfdl:lengthKind delimited) and (2) doesn't deal with 
escape schemes. For parsing the boundaryMark is found and removed, unparsing it 
is inserted. 
   
   Explicit is just a thing that halts data delivery after N bytes for parsing, 
does nothing at all on unparsing.
   
   Implicit just does nothing, parsing or unparsing. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to