From 0f16d2bd59cdf8af14eb56b77d4b4dacba02562b Mon Sep 17 00:00:00 2001 From: Marenz Date: Sun, 15 May 2011 20:47:54 +0200 Subject: [PATCH] D-Binding: created small wrapper f. parse function --- d/include/psyc/parse.d | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/d/include/psyc/parse.d b/d/include/psyc/parse.d index 52aa4da..9b8a700 100644 --- a/d/include/psyc/parse.d +++ b/d/include/psyc/parse.d @@ -144,6 +144,24 @@ struct ParseState return inst; } + /** + * Parse PSYC packets. + * + * Generalized line-based packet parser. + * + * Params: + * oper = A reference to a character. In case of a variable, it will + * be set to the operator of that variable + * name = A reference to a String. It will point to the name of + * the variable or method and its length will be set accordingly + * value = A reference to a String. It will point to the + * value/body the variable/method and its length will be set accordingly + */ + ParseRC parse ( ref char oper, ref char[] name, ref char[] value ) + { + return psyc_parse(this, &oper, cast(String*) &name, cast(String*) &value); + } + /** * Change parse flags in state * @@ -160,7 +178,7 @@ struct ParseState if (flags & ParseFlag.START_AT_CONTENT) this.part = Part.CONTENT; else - this.part = 0; + this.part = Part.ROUTING; } /** @@ -304,6 +322,7 @@ struct ParseListState } } +private: /** * Parse PSYC packets.