Apq.Cfg.Sources.File.FileCfgSourceBase.md 2.2 KB

Apq.Cfg

Apq.Cfg.Sources.File

FileCfgSourceBase Class

文件配置源基类,提供编码检测和写入编码功能

public abstract class FileCfgSourceBase : Apq.Cfg.Sources.ICfgSource, System.IDisposable

Inheritance System.Object 🡒 FileCfgSourceBase

Derived
JsonFileCfgSource

Implements ICfgSource, System.IDisposable

Properties
EncodingConfidenceThreshold 编码检测置信度阈值(0.0-1.0),可在运行时修改。 可通过环境变量 APQ_CFG_ENCODING_CONFIDENCE 设置默认值。
EncodingDetector 全局编码检测器实例
EncodingOptionsValue 编码选项
Methods
CreatePhysicalFileProvider(string) 创建 PhysicalFileProvider 并跟踪以便后续释放
DetectEncodingEnhanced(string) 检测文件编码(用于读取)- 使用增强的编码检测器
GetWriteEncoding() 获取写入编码