예제 #1
0
 public void Add(string attribute, int key)
 {
     if (builder == null)
     {
         builder = new VPackBuilder();
         builder.Add(SliceType.Object);
     }
     builder.AddCompactInt(attribute, key);
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public SliceWriter()
 {
     builder = new VPackBuilder();
 }