Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/09 15:15:48 (15 years ago)
Author:
epitzer
Message:

Unify token classes for parsing and formatting, make format specification mandatory. (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/Tokens.cs

    r1355 r1356  
    22namespace Persistence {
    33
    4   #region Serialization Tokens
     4  public interface ISerializationToken {}
    55
    6   public interface ISerializationToken {
    7   }
    86  public class BeginToken : ISerializationToken {   
    97    public readonly string Name;
     
    1614    }
    1715  }
     16
    1817  public class EndToken : ISerializationToken {
    1918    public readonly string Name;
     
    2625    }
    2726  }
     27
    2828  public class PrimitiveToken : ISerializationToken {
    2929    public readonly string Name;
     
    3838    }
    3939  }
     40
    4041  public class ReferenceToken : ISerializationToken {
    4142    public readonly string Name;
     
    4647    }
    4748  }
     49
    4850  public class NullReferenceToken : ISerializationToken {
    4951    public readonly string Name;
     
    5254    }
    5355  }
    54   #endregion
    55 
    56   #region DeSerialization Tokens
    57 
    58   public interface IParseToken { }
    59 
    60   public class CompositeStart : IParseToken {
    61     public readonly string Name;
    62     public readonly string TypeId;
    63     public readonly int? Id;
    64     public CompositeStart(string name, string typeId, int? id) {
    65       Name = name;
    66       TypeId = typeId;
    67       Id = id;
    68     }
    69   }
    70   public class CompositeEnd : IParseToken {
    71     public readonly string Name;
    72     public readonly string TypeId;
    73     public readonly int? Id;
    74     public CompositeEnd(string name, string typeId, int? id) {
    75       Name = name;
    76       TypeId = typeId;
    77       Id = id;
    78     }
    79   }
    80   public class Primitive : IParseToken {
    81     public readonly string Name;
    82     public readonly string TypeId;
    83     public readonly string SerializedValue;
    84     public readonly int? Id;
    85     public Primitive(string name, string typeId, string serilaizedValue, int? id) {
    86       Name = name;
    87       TypeId = typeId;
    88       SerializedValue = serilaizedValue;
    89       Id = id;
    90     }
    91   }
    92   public class Reference : IParseToken {
    93     public readonly string Name;
    94     public readonly int Id;
    95     public Reference(string name, int id) {
    96       Name = name;
    97       Id = id;
    98     }
    99   }
    100   public class Null : IParseToken {
    101     public readonly string Name;
    102     public Null(string name) {
    103       Name = name;
    104     }
    105   }
    106   #endregion
    10756
    10857}
Note: See TracChangeset for help on using the changeset viewer.