public void Add(string attribute, int key) { if (builder == null) { builder = new VPackBuilder(); builder.Add(SliceType.Object); } builder.AddCompactInt(attribute, key); }
public VPackAttributeTranslator() { builder = null; attributeToKey = new Dictionary <string, VPackSlice>(); keyToAttribute = new Dictionary <int, VPackSlice>(); try { Add(KEY, KEY_ATTRIBUTE - ATTRIBUTE_BASE); Add(REV, REV_ATTRIBUTE - ATTRIBUTE_BASE); Add(ID, ID_ATTRIBUTE - ATTRIBUTE_BASE); Add(FROM, FROM_ATTRIBUTE - ATTRIBUTE_BASE); Add(TO, TO_ATTRIBUTE - ATTRIBUTE_BASE); Seal(); } catch (VPackException e) { throw new Exception(e.Message, e); } }
public SliceWriter() { builder = new VPackBuilder(); }