cbor-d 0.1.0

Concise Binary Object Representation (CBOR) for D lang


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Concise Binary Object Representation (CBOR) for D language

	import cbor;
	
	struct Inner
	{
		int[] array;
		string someText;
	}

	struct Test
	{
		ubyte b;
		short s;
		uint i;
		long l;
		float f;
		double d;
		ubyte[] arr;
		string str;
		Inner inner;

		void fun(){} // not encoded
		void* pointer; // not encoded
		int* numPointer; // not encoded
	}

	ubyte[1024] buffer;
	size_t encodedSize;

	Test test = Test(42, -120, 111111, -123456789, 0.1234, -0.987654,
		cast(ubyte[])[1,2,3,4,5,6,7,8], "It is a test string",
		Inner([1,2,3,4,5], "Test of inner struct"));

	encodedSize = encodeCborArray(buffer[], test);
	Test result = decodeCborSingle!Test(buffer[0..encodedSize]);
	assert(test == result);
Authors:
  • Andrey Penechko
Dependencies:
none
Versions:
0.5.5 2018-Jan-25
0.5.4 2016-Oct-22
0.5.3 2016-Oct-03
0.5.2 2016-Jun-13
0.5.1 2016-Jun-04
Show all 15 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 1695 downloads total

Score:
1.9
Short URL:
cbor-d.dub.pm