sigma.serialization.BoolToSigmaPropSerializer.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sigma-state_2.12 Show documentation
Show all versions of sigma-state_2.12 Show documentation
Interpreter of a Sigma-State language
The newest version!
package sigma.serialization
import sigma.ast._
import sigma.ast.syntax._
import sigma.serialization.CoreByteWriter.DataInfo
import SigmaByteWriter._
case class BoolToSigmaPropSerializer(cons: BoolValue => SigmaPropValue) extends ValueSerializer[BoolToSigmaProp] {
import Operations.BoolToSigmaPropInfo._
override def opDesc = BoolToSigmaProp
val conditionInfo: DataInfo[SValue] = conditionArg
def serialize(obj: BoolToSigmaProp, w: SigmaByteWriter): Unit = {
w.putValue(obj.value, conditionInfo)
}
def parse(r: SigmaByteReader): Value[SType] = {
val p = r.getValue().asBoolValue
cons(p)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy