Object

spinoco.protocol.common

codec

Related Doc: package common

Permalink

object codec

Source
codec.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. codec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class ByteVectorCodecSyntax extends AnyVal

    Permalink
  2. implicit final class UnitCodecSyntax extends AnyVal

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val SPACE: Codec[Unit]

    Permalink

    codec that encodes/decodes to space *

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val asciiToken: Codec[String]

    Permalink
  7. def bitsOfString(s: String, chs: Charset = StandardCharsets.UTF_8): BitVector

    Permalink

    converts string to bits, given supplied encoding *

  8. lazy val bitsWsRemoved: Codec[BitVector]

    Permalink
  9. lazy val boolAsString: Codec[Boolean]

    Permalink
  10. def bytesUntil(f: (Byte) ⇒ Boolean): Codec[ByteVector]

    Permalink

    Decodes bytes util f holds.

    Decodes bytes util f holds. Encodes as identity

  11. lazy val bytesWsRemoved: Codec[ByteVector]

    Permalink
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def constantString1(s: String): Codec[Unit]

    Permalink

    codec that encodes and deoces to supplied string *

  14. def constantString1CaseInsensitive(s: String): Codec[Unit]

    Permalink

    like constantString1 but decodes when matches case insensitive.

    like constantString1 but decodes when matches case insensitive. Works fro ascii only. *

  15. def default[A](codec: Codec[A], default: A): Codec[A]

    Permalink

    Codec with a default value that is implied if there is no value in the supplied bits.

    Codec with a default value that is implied if there is no value in the supplied bits.

    If the value that is to be encoded is equal to the default value of the codec, then we do not encode anything.

    codec

    The codec to attempt to be decoded

  16. val defaultQuotableChars: Set[Char]

    Permalink
  17. lazy val digits: Codec[Int]

    Permalink
  18. def dropWhile(encodeAs: BitVector)(f: (Byte) ⇒ Boolean): Codec[Unit]

    Permalink

    drops while f holds.

    drops while f holds. Then when encoding uses encodeAs *

  19. def duration[N](units: TimeUnit, mkN: (Double) ⇒ N)(codec: Codec[N])(implicit N: Numeric[N]): Codec[FiniteDuration]

    Permalink

    creates duration from specified units *

  20. def durationIntMs(codec: Codec[Int]): Codec[FiniteDuration]

    Permalink

    encodes duration in Ms for Int *

  21. def enclosedBy[A](open: Char, close: Char)(codec: Codec[A]): Codec[A]

    Permalink

    When decoding takes up bytes if open and close character are found.

    When decoding takes up bytes if open and close character are found. if there are multiple open characters found, this decodes until matching close characters are found. When encoding wraps the result of codec to open and close characters

  22. val epochTimestamp: Codec[Date]

    Permalink

    encodes as ms since epoch *

  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  25. val eventuallyQuotedAsciiString: Codec[String]

    Permalink
  26. def eventuallyQuotedString(quotableChars: Set[Char], quote: Char = '"', escape: Char = '\\', charset: Charset = StandardCharsets.UTF_8): Codec[String]

    Permalink

    Decodes string from eventually quoted string.

    Decodes string from eventually quoted string. If the decoded string was not quoted and contains chars within quotableChars the encoding will fail

    quotableChars

    Chars that must be quoted

    quote

    A quoting char

    escape

    An escape char used to escape quote and eventually other chars.

    charset

    Charset

  27. val eventuallyQuotedUTF8String: Codec[String]

    Permalink
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. lazy val floatAsString: Codec[Float]

    Permalink

    Float encoded as string value

  30. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  31. def guard[A](c: Codec[A])(f: (A) ⇒ Option[Err]): Codec[A]

    Permalink

    Applies predicate f to check whether A was decoded successfully, or may be encoded.

    Applies predicate f to check whether A was decoded successfully, or may be encoded. If f yields to String, then this signals failure

  32. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  33. def ignoreBytes(f: (Byte) ⇒ Boolean): Codec[Unit]

    Permalink

    a codec that will ignore when decoding all bytes until f holds, On encoding will encode to empty *

  34. val ignoreWS: Codec[Unit]

    Permalink

    codec that ignores any Whitespace when decoding *

  35. lazy val intAsString: Codec[Int]

    Permalink

    Int encoded as string value

  36. def intBounded(codec: Codec[Int])(min: Int, max: Int): Codec[Int]

    Permalink

    int codec, that allows min/max bounds inclusive *

  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. lazy val longAsString: Codec[Long]

    Permalink

    Int encoded as string value

  39. def lookahead2(codec: Codec[Unit]): Codec[Boolean]

    Permalink

    correct version of lookahead that won't encode codec when encoding *

  40. def maxItems[A, F[_] <: GenTraversable[_]](sz: Int)(codec: Codec[F[A]]): Codec[F[A]]

    Permalink

    will encode a collection of A with at max size of sz *

  41. def maybe[A](codec: Codec[A]): Codec[Option[A]]

    Permalink

    A maybe value, that should be encoded only if there is some value present.

    A maybe value, that should be encoded only if there is some value present.

    Tries to decode the value using the given codec, if the decode fails we return None.

    codec

    The codec to attempt to be decoded/encoded

  42. def minItems[A, F[_] <: GenTraversable[_]](sz: Int)(codec: Codec[F[A]]): Codec[F[A]]

    Permalink

    will encode a collection of A with min size of at least sz *

  43. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  44. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. val quotedAsciiString: Codec[String]

    Permalink

    codec for ascii strings that may be quoted *

  47. val quotedAsciiToken: Codec[String]

    Permalink
  48. def quotedString(charset: Charset, quote: Char = '"', escape: Char = '\\'): Codec[String]

    Permalink

    A generic codec to encode quoted string.

    A generic codec to encode quoted string.

    Quoted string starts with Ascii quote char and continues with any character, compatible with charset. Characters may be escaped by escape and correct character. Any quote char must be escaped.

    charset

    Charset of the string. Must be ASCII backward compatible, not using first 7 bits of each byte for the characters except the ascii ones.

    quote

    Quote enclosing the string. Must be ascii character

    escape

    Escape char, must be ascii.

  49. val quotedUTF8String: Codec[String]

    Permalink
  50. def recover2(codec: Codec[Unit]): Codec[Boolean]

    Permalink

     like Recover codec, but with fixed encode *

  51. def set[A](codec: Codec[A]): Codec[Set[A]]

    Permalink

    Codec for a set of a given A.

    Codec for a set of a given A.

    codec

    The codec of A that is to be used for decoding values.

  52. def stringBounded(codec: Codec[String])(min: Int, max: Int): Codec[String]

    Permalink

    string codec, that allows min/max bounds on size inclusive *

  53. def stringEnumerated(discriminator: Codec[String], enumeration: Enumeration): DiscriminatorCodec[Value, String]

    Permalink
  54. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  55. def tagged[A, T](codec: Codec[A]): Codec[@@[A, T]]

    Permalink

    tags value A with T *

  56. def takeWhile[A](codec: Codec[A])(f: (Byte) ⇒ Boolean): Codec[A]

    Permalink

    takes bytes until f holds, then decodes via codec *

  57. def takeWhile[A](discriminator: ByteVector, encodingDiscriminator: ByteVector, codec: Codec[A], maxLength: Int = Int.MaxValue): Codec[A]

    Permalink

    A codec that takes all bytes until discriminator is found.

    A codec that takes all bytes until discriminator is found. Then codec is applied to get A Remainder AFTER discriminator is returned

  58. def takeWhileChar[A](codec: Codec[A])(char: Char, chars: Char*): Codec[A]

    Permalink

    takes bytes until char or chars are encountered *

  59. def terminated[A](codec: Codec[A], terminator: Terminator[Unit]): Codec[A]

    Permalink

    A codec, that on decoding will first decode via terminator and when that will be successful, will take all bits returned by terminator and passes them to be decoded by codec.

    A codec, that on decoding will first decode via terminator and when that will be successful, will take all bits returned by terminator and passes them to be decoded by codec.

    On encoding, this will encode A followed by terminator.

    codec

    Codec that encodes/decodes A

    terminator

    Terminator that returns sequence of data for codec

  60. def terminatedBy[A](delimiter: ByteVector, encDelimiter: ByteVector, codec: Codec[A]): Codec[A]

    Permalink

    Decodes bytes that are terminated by supplied byte, and then applies codec on bytes decoded differs from codec ~ delimiter so the delimiter is scanned first and then codec is applied.

    Decodes bytes that are terminated by supplied byte, and then applies codec on bytes decoded differs from codec ~ delimiter so the delimiter is scanned first and then codec is applied.

    The delimiter is not part of any remainder returned when decoding.

    instead using delimiter to encode, encDelimiter is used.

  61. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  62. def token(codec: Codec[String], terminator: Char = ' '): Codec[String]

    Permalink

    Decodes to token(string) eventually terminated by terminator.

    Decodes to token(string) eventually terminated by terminator. Terminator is not customed by this codec.. encodes to codec. Terminator must be Ascii Char

    codec

    codec to terminate the value

    terminator

    tzerminator

  63. def untilEOL[A](codec: Codec[A], encodeNewLine: BitVector = BitVector.view("\r\n".getBytes)): Codec[A]

    Permalink

    codec that decodes codec, until EOL signature is found.

    codec that decodes codec, until EOL signature is found. EOL is defined as crlf or lf only*

  64. def untilWs[A](codec: Codec[A]): Codec[A]

    Permalink

    codec that takes until any whitespace and then this applies supplied codec *

  65. val utf8Token: Codec[String]

    Permalink
  66. def vectorV[A](codec: Codec[A]): Codec[Vector[A]]

    Permalink

    like vector[A], but instead consuming all bytes on decoding will try to consume all bytes that match for A and will leave last bytes that did not match as remainder.

    like vector[A], but instead consuming all bytes on decoding will try to consume all bytes that match for A and will leave last bytes that did not match as remainder. May encode to Vector.empty if A did not match at all.

    codec

    Codec for A

  67. def vectorVDelimited[A](codec: Codec[A], delimiter: Codec[Unit], firstWithDelimiter: Boolean = false): Codec[Vector[A]]

    Permalink

    Like VectorV, but the items are delimited by Delimiter.

    Like VectorV, but the items are delimited by Delimiter. Last item will not be terminated by delimiter

    firstWithDelimiter

    if set to true, first element will start with delimiter

  68. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  70. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def xor[A](codec: Codec[A], or: BitVector): Codec[A]

    Permalink

    Performs Xor operation of codec with or

Inherited from AnyRef

Inherited from Any

Ungrouped