namespace Eva { public class Binary : Object, Term { public void* data {get; private set;} public long len {get; private set;} public string string_value { owned get{ return binary_to_string(data, len); } } public Binary(char[] v) { data = Memory.dup(v, (uint)(sizeof(char)*v.length)); len = v.length; } public string to_string() { return "#Bin"; } protected bool do_match(Term o, Gee.Map vars, Gee.Map aliases) { if(o is Var) { return o.do_match(this, vars, aliases); } if(o is Binary) { Binary b = o as Binary; if(b.len != len) return false; return (Memory.cmp(data, b.data, len) == 0); } else { return false; } } internal void encode(Buffer buffer) { buffer.buffer.encode_binary(data, len); } } }