예제 #1
0
파일: Toml.cs 프로젝트: zanedp/Nett
        public static T ReadString <T>(string toRead, TomlSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            TomlTable tt     = ReadString(toRead, settings);
            T         result = tt.Get <T>();

            return(result);
        }
예제 #2
0
        void ITomlObjectVisitor.Visit(TomlTable table)
        {
            Type tableToTypeMappingTargetType;

            if ((tableToTypeMappingTargetType = table.Root.Settings.TryGetMappedType(this.currentKey, null)) != null)
            {
                this.table[this.currentKey] = table.Get(tableToTypeMappingTargetType);
            }
            else
            {
                var conv = new ConvertTomlTableToDictionaryConversionVisitor();
                this.table[this.currentKey] = conv.Convert(table);
            }
        }