Coverage Summary for Class: GhostProtoJsonFlatReader (com.ghost.serialization.parser)
| Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| GhostProtoJsonFlatReader |
100%
(1/1)
|
77.8%
(7/9)
|
|
81.8%
(9/11)
|
87.9%
(29/33)
|
@file:OptIn(InternalGhostApi::class)
package com.ghost.serialization.parser
import com.ghost.serialization.InternalGhostApi
import com.ghost.serialization.parser.GhostJsonFlatReader
import com.ghost.serialization.parser.JsonReaderOptions
import com.ghost.serialization.parser.GhostHeuristics
import com.ghost.serialization.parser.GhostJsonConstants as C
class GhostProtoJsonFlatReader(
rawData: ByteArray,
maxDepth: Int = C.MAX_DEPTH,
maxCollectionSize: Int = GhostHeuristics.maxCollectionSize
) : GhostJsonFlatReader(rawData, maxDepth = maxDepth, maxCollectionSize = maxCollectionSize) {
override fun nextFloat(): Float = nextProtoFloat()
override fun nextDouble(): Double = nextProtoDouble()
override fun nextInt(): Int = nextProtoInt32()
override fun nextLong(): Long = nextProtoInt64()
fun nextProtoUInt32(): Long = readProtoUInt32()
/**
* Full `uint64` range (0 to [ULong.MAX_VALUE]) — accepts either the canonical quoted
* decimal string or a bare JSON number (only safe for values within [Long.MAX_VALUE]).
*/
fun nextProtoUInt64(): ULong = readProtoUInt64()
fun nextProtoBytes(): ByteArray = readProtoBytes()
fun nextProtoEnum(options: JsonReaderOptions): Int = readProtoEnum(options)
}