Giter VIP home page Giter VIP logo

inifile's People

Contributors

tangchr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

inifile's Issues

Don't work with boolean

when i use Get to "Param=1" i expect get "true"
and i use Get to "Param=0" i expect get "false"

but i got error

There is code to fix this bug

` public T Get(string name, T defvalue)
{

        if (_properties.ContainsKey(name))
            if (typeof(T) == typeof(bool))
                if (Convert.ToInt32(_properties[name].Value)==0) return  (T)Convert.ChangeType(false, typeof(T));
                else return (T)Convert.ChangeType(true, typeof(T));
            else return (T)Convert.ChangeType(_properties[name].Value, typeof(T));

        return defvalue;//default(T);
    }`

And also i add code to more comfortable use
Such as Param1 = IniFile.Get("Section1", "Param1", true);

public T Get<T>(string section, string name, T defvalue) { return Section(section).Get<T>(name,defvalue); }

Case sensitive is bug or normal work?

"Param=1" and "param=1" is different names in this realisation.

From other side in Delphi TIniFile , for example "Param=1" and "param=1" is equivalent.

if there has duplicate keys will lose data

string filename = "C:\\Users\\username\\AppData\\Local\\TslGame\\Saved\\Config\\WindowsNoEditor\\GameUserSettings.ini";
var iniFile = new IniFile.IniFile(filename);           
iniFile.Save(filename);
#pubg game GameUserSettings.ini

[/Script/TslGame.TslGameUserSettings]
ScreenScale=100.000000
...
ErangelPreloadingMaps=Grid-Level_1-1
ErangelPreloadingMaps=Grid-Level_1-2
ErangelPreloadingMaps=Grid-Level_1-5
ErangelPreloadingMaps=Grid-Level_1-6
ErangelPreloadingMaps=Grid-Level_2-2
ErangelPreloadingMaps=Grid-Level_2-3
ErangelPreloadingMaps=Grid-Level_3-1
ErangelPreloadingMaps=Grid-Level_3-2
ErangelPreloadingMaps=Grid-Level_3-3
ErangelPreloadingMaps=Grid-Level_3-4
ErangelPreloadingMaps=Grid-Level_4-2
ErangelPreloadingMaps=Grid-Level_4-3
ErangelPreloadingMaps=Grid-Level_4-6
ErangelPreloadingMaps=Grid-Level_5-1
ErangelPreloadingMaps=Grid-Level_5-2
ErangelPreloadingMaps=Grid-Level_5-4
ErangelPreloadingMaps=Grid-Level_5-5
ErangelPreloadingMaps=Grid-Level_5-6
ErangelPreloadingMaps=Grid-Level_6-1
ErangelPreloadingMaps=Grid-Level_6-2
ErangelPreloadingMaps=Grid-Level_6-3
ErangelPreloadingMaps=Grid-Level_6-4
ErangelPreloadingMaps=Grid-Level_6-5
ErangelPreloadingMaps=Grid-Level_6-6

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.