Skip to content

Commit

Permalink
Remove unused NeedRaw enum and needRaw() method
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Oct 16, 2023
1 parent e0c94b5 commit 3277c6e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
24 changes: 0 additions & 24 deletions shared/src/main/scala/io/kaitai/struct/datatype/NeedRaw.scala

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.kaitai.struct.languages.components

import io.kaitai.struct.datatype._
import io.kaitai.struct.datatype.DataType.{SwitchType, UserTypeFromBytes, BytesType}
import io.kaitai.struct.exprlang.Ast
import io.kaitai.struct.format._

Expand Down Expand Up @@ -91,25 +90,6 @@ trait CommonReads extends LanguageCompiler {

def attrParse2(id: Identifier, dataType: DataType, io: String, rep: RepeatSpec, isRaw: Boolean, defEndian: Option[FixedEndian], assignType: Option[DataType] = None): Unit

def needRaw(dataType: DataType): NeedRaw = {
val rawIo = dataType match {
case _: UserTypeFromBytes => true
case st: SwitchType => st.hasSize
case _ => false
}
val rawProcess = dataType match {
case bt: BytesType => bt.process.nonEmpty
case utfb: UserTypeFromBytes => utfb.bytes.process.nonEmpty
case _ => false
}
(rawIo, rawProcess) match {
case (true, false) => RawIo
case (false, true) => RawProcess
case (true, true) => RawIoProcess
case _ => NotRaw
}
}

def attrDebugStart(attrId: Identifier, attrType: DataType, io: Option[String], repeat: RepeatSpec): Unit = {}
def attrDebugArrInit(attrId: Identifier, attrType: DataType): Unit = {}
def attrDebugEnd(attrName: Identifier, attrType: DataType, io: String, repeat: RepeatSpec): Unit = {}
Expand Down

0 comments on commit 3277c6e

Please sign in to comment.