Skip to content

ne-sachirou/LTSV.NET

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LTSV.NET

Just simple C# (.NET) implementation for LTSV (Labeled Tab-separated Values).

Install

Install from NuGet (NuGet Gallery | LTSV.NET).

PM> Install-Package LTSV

Usage

Using namespace.

using LTSV;

Parse an LTSV record.

Ltsv.ParseLine("time:28/Feb/2013:12:00:00 +0900\thost:192.168.0.1\treq:GET /list HTTP/1.1\tstatus:200\n");
// => new Dictionary<string, string>
//    {
//        { "time", "28/Feb/2013:12:00:00 +0900" },
//        { "host", "192.168.0.1" },
//        { "req", "GET /list HTTP/1.1" },
//        { "status", "200" }
//    };

Build an LTSV record.

Ltsv.BuildLine(new Dictionary<string, string>
    {
        { "time", "28/Feb/2013:12:00:00 +0900" },
        { "host", "192.168.0.1" },
        { "req", "GET /list HTTP/1.1" },
        { "status", "200" }
    });
// => "time:28/Feb/2013:12:00:00 +0900\thost:192.168.0.1\treq:GET /list HTTP/1.1\tstatus:200"

Parse LTSV.

var ltsvStr = "hunter:sAccan\tmOmonga:10\nhunter:lotus_gate\tmOmonga:1e6";
new Ltsv(ltsvStr).Records;
new Ltsv().Parse(ltsvStr).Records;

Build LTSV.

var ltsv = new Ltsv("hunter:sAccan\tmOmonga:10\nhunter:lotus_gate\tmOmonga:1e6");
Console.WriteLine(ltsv.ToString());

License

(Public Domain)2013 ne_Sachirou <utakata.c4se@gmail.com>

About

Just simple C# implementation of LTSV (Labeled Tab-separated Values).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published