update license info

This commit is contained in:
munna0908 2025-05-22 16:39:37 +05:30
parent eadc7e2d16
commit 84943dbed9
No known key found for this signature in database
GPG Key ID: 2FFCD637E937D3E6
7 changed files with 33 additions and 14 deletions

View File

@ -1,3 +1,6 @@
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import std/[math, streams, options, tables, strutils, times, typetraits]
import ./types
import ./helpers
@ -134,16 +137,6 @@ func bytesLen*(c: CborParser): ?!int =
return failure(newCborError("Expected bytes, got " & $c.kind))
return success(c.intVal.int)
template tryNext(c: var CborParser) =
let nextRes = c.next()
if nextRes.isFailure:
return failure(nextRes.error)
template trySkip(c: var CborParser) =
let skipRes = c.skipNode()
if skipRes.isFailure:
return failure(skipRes.error)
proc nextBytes*(c: var CborParser; buf: var openArray[byte]): ?!void =
## Read the bytes that the parser is positioned on and advance.
try:

View File

@ -1,8 +1,10 @@
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import ../utils/types
import ./types
import std/sets
proc newUnexpectedKindError*(
expectedType: type, expectedKinds: string, cbor: CborNode
): ref UnexpectedKindError =

View File

@ -1,8 +1,21 @@
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import ./types
import ./errors
from macros import newDotExpr, newIdentNode, strVal
template tryNext*(c: var CborParser) =
let nextRes = c.next()
if nextRes.isFailure:
return failure(nextRes.error)
template trySkip*(c: var CborParser) =
let skipRes = c.skipNode()
if skipRes.isFailure:
return failure(skipRes.error)
template exceptCborKind*(expectedType: type, expectedKinds: set[CborNodeKind],
cbor: CborNode) =
if cbor.kind notin expectedKinds:

View File

@ -1,3 +1,6 @@
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import std/[base64, tables]
import ../json/stdjson
import ./types

View File

@ -1,4 +1,7 @@
import std/[streams, options, tables, typetraits, math, endians, times, base64]
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import std/[streams, options, tables, typetraits, math, endians, times]
import pkg/questionable
import pkg/questionable/results
import ../utils/errors

View File

@ -1,3 +1,6 @@
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import std/[streams, tables, options, hashes, times]
const timeFormat* = initTimeFormat "yyyy-MM-dd'T'HH:mm:sszzz"

View File

@ -1,5 +1,7 @@
import
std/[base64, os, random, times, json, unittest]
# This file is a modified version of Emery Hemingways CBOR library for Nim,
# originally available at https://github.com/ehmry/cbor-nim and released under The Unlicense.
import std/[base64, os, random, times, json, unittest]
import pkg/serde/cbor
import pkg/questionable
import pkg/questionable/results