Example #1
0
 public static VdfDocument ParceFile(string path)
 {
     using (var reader = File.OpenText(path))
     {
         reader.ReadEmpty();
         if (!reader.ReadLimiter())
         {
             throw new Exception(reader.BaseStream.Position + ": Limiter expected");
         }
         var key = reader.ReadText();
         if (key == null)
         {
             throw new Exception(reader.BaseStream.Position + ": key must be not null");
         }
         if (!reader.ReadLimiter())
         {
             throw new Exception(reader.BaseStream.Position + ": Limiter expected");
         }
         var value = VdfValue.Parce(reader);
         return(new VdfDocument(key, value));
     }
 }
Example #2
0
 public VdfDocument(string key, VdfValue value)
 {
     _key   = key;
     _value = value;
 }