Object

spinoco.protocol.common

codec

Related Doc: package common

Permalink

object codec

Source
codec.scala
Linear Supertypes
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 ISO-8859-1: Codec[String]

    Permalink
  5. val SPACE: Codec[Unit]

    Permalink

    codec that encodes/decodes to space *

  6. final def asInstanceOf[T0]: T0

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

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

    Permalink

    converts string to bits, given supplied encoding *

  9. lazy val bitsWsRemoved: Codec[BitVector]

    Permalink
  10. lazy val boolAsString: Codec[Boolean]

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

    Permalink

    Decodes bytes util f holds.

    Decodes bytes util f holds. Encodes as identity

  12. lazy val bytesWsRemoved: Codec[ByteVector]

    Permalink
  13. def clone(): AnyRef

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

    Permalink

    codec that encodes and deoces to supplied string *

  15. 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. *

  16. 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

  17. val defaultHttpQuotableChars: Set[Char]

    Permalink
  18. val defaultQuotableChars: Set[Char]

    Permalink
  19. lazy val digits: Codec[Int]

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

    Permalink

    drops while f holds.

    drops while f holds. Then when encoding uses encodeAs *

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

    Permalink

    creates duration from specified units *

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

    Permalink

    encodes duration in Ms for Int *

  23. 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

  24. val epochTimestamp: Codec[Date]

    Permalink

    encodes as ms since epoch *

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

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

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

    Permalink
  28. 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

  29. def finalize(): Unit

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

    Permalink

    Float encoded as string value

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

    Permalink
    Definition Classes
    AnyRef → Any
  32. 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

  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. val httpMaybeQuotedUTF8String: Codec[String]

    Permalink
  35. 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 *

  36. val ignoreWS: Codec[Unit]

    Permalink

    codec that ignores any Whitespace when decoding *

  37. lazy val intAsString: Codec[Int]

    Permalink

    Int encoded as string value

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

    Permalink

    int codec, that allows min/max bounds inclusive *

  39. final def isInstanceOf[T0]: Boolean

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

    Permalink

    Int encoded as string value

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

    Permalink

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

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

    Permalink

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

  43. 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

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

    Permalink

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

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

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

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

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

    Permalink

    codec for ascii strings that may be quoted *

  49. val quotedAsciiToken: Codec[String]

    Permalink
  50. 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.

  51. val quotedUTF8String: Codec[String]

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

    Permalink

     like Recover codec, but with fixed encode *

  53. 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.

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

    Permalink

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

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

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

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

    Permalink

    tags value A with T *

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

    Permalink

    takes bytes until f holds, then decodes via codec *

  59. 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

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

    Permalink

    takes bytes until char or chars are encountered *

  61. 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

  62. 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.

  63. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  64. 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

  65. 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*

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

    Permalink

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

  67. val utf8Token: Codec[String]

    Permalink
  68. 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

  69. 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

  70. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. 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