/**
* DpDeukJsonProtocol — Deuk JSON (값만) 프로토콜.
* 설정·OpenAPI 라운드트립용. 타입 래퍼 없음. 레거시 호환 JSON(DpJsonProtocol)과 별도.
* See: DeukPack/docs/DEUKPACK_DEUK_JSON_YAML.md
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace DeukPack.Protocol
{
///
/// Deuk JSON protocol: value-only JSON for config/OpenAPI round-trip.
/// No type wrappers (i64/str/tf). Optional $deuk header. Use field names as keys when writing.
///
public class DpDeukJsonProtocol : DpProtocol, IDisposable
{
public const string DeukFormatVersion = "deuk/1.0";
public const string HeaderKeyDeuk = "$deuk";
public const string HeaderKeyDeukFormat = "deukFormat";
private readonly Stream _stream;
private readonly bool _isReadMode;
private readonly bool _includeDeukHeader;
private readonly bool _pretty;
private readonly Stack _writeStack;
private readonly Stack> _listWriteStack;
private readonly Stack _mapWriteStack;
private string _currentFieldKey = "";
private DpWireType _currentFieldType;
private Dictionary _rootRead;
private Stack _readStack;
private KeyValuePair? _currentReadField;
private List