Coder Social home page Coder Social logo

xconf's Introduction

Xconf

  • Project: Xconf

Library for parsing a config file with strong typed defined values.

  • Provider Class

The provider class uses the base principles from the Dict(Of TKey, TValue) using the 'Key', it also keeps track if the config file has been changed externally, if this happens it will automaticly update itself.

  • Config format:
{key}       :{type}   : {value};

test.num    : int32   : 100;
test.float  : float   : 3.14;
test.bool   : boolean : True;
test.string : string  : "Hello, World!";  
  • Accepted key formats
Key      = a-z 0-9 . _

Accepted type formats

type     = byte, int16, int32, int64, float, string, boolean
  • Setup
dim table as Xconf.provider = Xconf.Parser.Create({filename})
  • Methods

Cast object without type check, throws exception if type mismatched

table({key}).Cast(Of T)() as T
table({key}).ToByte() as Byte
table({key}).ToInt16() as Int16
table({key}).ToInt32() as Int32
table({key}).ToInt64() as Int64
table({key}).ToDouble() as Double
table({key}).ToBoolean() as Boolean
table({key}).ToString() as String

Cast object with type check, throws no exception but returns nothing if fails

table({key}).TryCast(Of T)() As T

xconf's People

Contributors

thebarret avatar

Watchers

 avatar

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.