File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
opentak/src/main/scala/com/github/daenyth/opentak/protocol Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,19 @@ import com.github.daenyth.taklib._
66
77import scala .util .parsing .combinator .RegexParsers
88
9+ /**
10+ * Playtak protocol encoding/decoding between the wire
11+ * representation (string) and in-library representation (case classes)
12+ *
13+ * See PlaytakCodec#encode and PlaytakCodec#decode
14+ */
915object PlaytakCodec {
16+ def encode (outgoing : Playtak .Outgoing ): String =
17+ Outgoing .encode(outgoing)
18+ def decode (input : String ): Either [String , Playtak .Incoming ] =
19+ Incoming .parseEither(Incoming .incoming, input).toEither
20+
21+ /* Abandon hope all ye who scroll below here */
1022
1123 object Incoming extends RegexParsers with RichParsing {
1224 def decode (input : String ): Either [String , Playtak .Incoming ] =
You can’t perform that action at this time.
0 commit comments