Beispiel #1
0
        /// <summary>
        /// Gets the native type that corresponds to the specified TomlType.
        /// </summary>
        /// <param name="type">The TomlType to find the corresponding Native Type for.</param>
        /// <returns>A Type that corresponds to the TomlType.</returns>
        private static Type TomlTypeToNative(TomlType type)
        {
            switch (type)
            {
            case TomlType.Int: return(typeof(Int64));

            case TomlType.Float: return(typeof(double));

            case TomlType.Boolean: return(typeof(bool));

            case TomlType.DateTime: return(typeof(DateTime));

            case TomlType.String: return(typeof(string));

            default: return(typeof(object));
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the Entry class.
 /// </summary>
 public Entry(Array parent, string group, string source, int startLineNumber, int startPos, TomlType parsedType)
 {
     this.Parent     = parent;
     this.Group      = group ?? string.Empty;
     this.Name       = Array.GetEntryName(parent);
     this.SourceText = source;
     this.LineNumber = startLineNumber;
     this.Position   = startPos;
     this.ParsedType = parsedType;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the Entry class.
 /// </summary>
 public Entry(string group, string name, string source, int startLineNumber, int startPos, TomlType parsedType)
 {
     this.Group      = group ?? string.Empty;
     this.Name       = name;
     this.SourceText = source;
     this.LineNumber = startLineNumber;
     this.Position   = startPos;
     this.ParsedType = parsedType;
 }