Code Monkey home page Code Monkey logo

infhelper's Introduction

InfHelper

License

  • Nuget package for C# that makes it easy to parse .inf files, to store and work with information about system drivers.
  • This NuGet Package allows you to parse .inf files and browse them using object model wrappers (using the InfData class). You can browse categories and their keys by handling them as collections or simply using [id] operators. Currently, this package does not support installing drivers from inf files, only parsing and browsing through the file. The feature for creating an INF file will be added in later versions.

How to use

Init parsing

var helper = new InfUtil();
var data = helper.ParseFile(path);

Getting data

//obtain category by id
var version = data["Version"];

//get keys from the category
var providerKey = version["Provider"];
var classGuidKey = version["ClassGuid"];

//obtain key directely
var key = data["Strings"]["KeyId"];


// get list of vaues separated by comma
var values = key.KeyValues;

//get value
var value = values[0].Value;

if(value.IsDynamic){
//the key value refers to another key
}

//you can also ignore all wrappers and just get the primitive value (string)
var value = key.PrimitiveValue;

Custom driver info serialization

public class DriverInfo
    {
        [InfKeyValue("Version","Class")]
        public string Class { get; set; }
        [InfKeyValue("Version", "Provider")]
        public string Provider { get; set; }
    }

    // ....

    var helper = new InfUtil();
    var serilized = helper.SerializeFileInto<DriverInfo>(Path.Combine(testFolder, 
    "oem100.inf" out InfData data);

infhelper's People

Contributors

skalahonza avatar nikolausmoll avatar michaeljj avatar dschmidlin avatar 1redone 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.