Describe a log that records the changes made since a specific checkpoint
Inheritance: LogEntry
Example #1
0
		/// <summary>
        /// Construct an instance from the specified tagged JSONReader stream.
        /// </summary>
        /// <param name="JSONReader">Input stream</param>
        /// <param name="Out">The created object</param>
        public static void Deserialize(JSONReader JSONReader, out JSONObject Out) {
	
			JSONReader.StartObject ();
            if (JSONReader.EOR) {
                Out = null;
                return;
                }

			string token = JSONReader.ReadToken ();
			Out = null;

			switch (token) {

				case "DataItem" : {
					var Result = new DataItem ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "Header" : {
					var Result = new Header ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "Delta" : {
					var Result = new Delta ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "IndexTerm" : {
					var Result = new IndexTerm ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "Final" : {
					var Result = new Final ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "Terminal" : {
					var Result = new Terminal ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "IndexIndex" : {
					var Result = new IndexIndex ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "Index" : {
					var Result = new Index ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}


				case "IndexEntry" : {
					var Result = new IndexEntry ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}

				default : {
					throw new Exception ("Not supported");
					}
				}	
			JSONReader.EndObject ();
            }
Example #2
0
        /// <summary>
        /// Having read a tag, process the corresponding value data.
        /// </summary>
        /// <param name="JSONReader">The input stream</param>
        /// <param name="Tag">The tag</param>
		public override void DeserializeToken (JSONReader JSONReader, string Tag) {
			
			switch (Tag) {
				case "Type" : {
					Type = JSONReader.ReadString ();
					break;
					}
				case "Content" : {
					Content = JSONReader.ReadString ();
					break;
					}
				case "Comment" : {
					Comment = JSONReader.ReadString ();
					break;
					}
				case "Digest" : {
					Digest = JSONReader.ReadString ();
					break;
					}
				case "LastDigest" : {
					LastDigest = JSONReader.ReadBinary ();
					break;
					}
				case "Delta" : {
					// An untagged structure
					Delta = new Delta (JSONReader);
 
					break;
					}
				default : {
					break;
					}
				}
			// check up that all the required elements are present
			}
Example #3
0
        /// <summary>
        /// Deserialize a tagged stream
        /// </summary>
        /// <param name="JSONReader">The input stream</param>
        /// <returns>The created object.</returns>		
        public static new Delta  FromTagged (JSONReader JSONReader) {
			Delta Out = null;

			JSONReader.StartObject ();
            if (JSONReader.EOR) {
                return null;
                }

			string token = JSONReader.ReadToken ();

			switch (token) {

				case "Delta" : {
					var Result = new Delta ();
					Result.Deserialize (JSONReader);
					Out = Result;
					break;
					}

				default : {
					//Ignore the unknown data
                    //throw new Exception ("Not supported");
                    break;
					}
				}
			JSONReader.EndObject ();

			return Out;
			}