├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── app-support-request---请求-app-支持.md │ └── bug-report---报告-bug.md ├── .gitignore ├── CManyDownload.cpp ├── CManyDownload.h ├── CONTRIBUTING.md ├── CWorkshops_info.cpp ├── CWorkshops_info.h ├── LICENSE.txt ├── README.md ├── SWTools.cpp ├── SWTools.h ├── SWTools.rc ├── SWTools.sln ├── SWTools.vcxproj ├── SWTools.vcxproj.filters ├── SWToolsDlg.cpp ├── SWToolsDlg.h ├── backend ├── app_info.hpp ├── backend.hpp ├── downloader.hpp ├── eula.hpp ├── nlohmann │ ├── LICENSE.MIT │ ├── adl_serializer.hpp │ ├── byte_container_with_subtype.hpp │ ├── detail │ │ ├── abi_macros.hpp │ │ ├── conversions │ │ │ ├── from_json.hpp │ │ │ ├── to_chars.hpp │ │ │ └── to_json.hpp │ │ ├── exceptions.hpp │ │ ├── hash.hpp │ │ ├── input │ │ │ ├── binary_reader.hpp │ │ │ ├── input_adapters.hpp │ │ │ ├── json_sax.hpp │ │ │ ├── lexer.hpp │ │ │ ├── parser.hpp │ │ │ └── position_t.hpp │ │ ├── iterators │ │ │ ├── internal_iterator.hpp │ │ │ ├── iter_impl.hpp │ │ │ ├── iteration_proxy.hpp │ │ │ ├── iterator_traits.hpp │ │ │ ├── json_reverse_iterator.hpp │ │ │ └── primitive_iterator.hpp │ │ ├── json_custom_base_class.hpp │ │ ├── json_pointer.hpp │ │ ├── json_ref.hpp │ │ ├── macro_scope.hpp │ │ ├── macro_unscope.hpp │ │ ├── meta │ │ │ ├── call_std │ │ │ │ ├── begin.hpp │ │ │ │ └── end.hpp │ │ │ ├── cpp_future.hpp │ │ │ ├── detected.hpp │ │ │ ├── identity_tag.hpp │ │ │ ├── is_sax.hpp │ │ │ ├── std_fs.hpp │ │ │ ├── type_traits.hpp │ │ │ └── void_t.hpp │ │ ├── output │ │ │ ├── binary_writer.hpp │ │ │ ├── output_adapters.hpp │ │ │ └── serializer.hpp │ │ ├── string_concat.hpp │ │ ├── string_escape.hpp │ │ ├── string_utils.hpp │ │ └── value_t.hpp │ ├── json.hpp │ ├── json_fwd.hpp │ ├── ordered_map.hpp │ └── thirdparty │ │ └── hedley │ │ ├── hedley.hpp │ │ └── hedley_undef.hpp ├── process.hpp ├── texts.hpp └── update.hpp ├── framework.h ├── include └── nlohmann │ ├── LICENSE.MIT │ ├── adl_serializer.hpp │ ├── byte_container_with_subtype.hpp │ ├── detail │ ├── abi_macros.hpp │ ├── conversions │ │ ├── from_json.hpp │ │ ├── to_chars.hpp │ │ └── to_json.hpp │ ├── exceptions.hpp │ ├── hash.hpp │ ├── input │ │ ├── binary_reader.hpp │ │ ├── input_adapters.hpp │ │ ├── json_sax.hpp │ │ ├── lexer.hpp │ │ ├── parser.hpp │ │ └── position_t.hpp │ ├── iterators │ │ ├── internal_iterator.hpp │ │ ├── iter_impl.hpp │ │ ├── iteration_proxy.hpp │ │ ├── iterator_traits.hpp │ │ ├── json_reverse_iterator.hpp │ │ └── primitive_iterator.hpp │ ├── json_custom_base_class.hpp │ ├── json_pointer.hpp │ ├── json_ref.hpp │ ├── macro_scope.hpp │ ├── macro_unscope.hpp │ ├── meta │ │ ├── call_std │ │ │ ├── begin.hpp │ │ │ └── end.hpp │ │ ├── cpp_future.hpp │ │ ├── detected.hpp │ │ ├── identity_tag.hpp │ │ ├── is_sax.hpp │ │ ├── std_fs.hpp │ │ ├── type_traits.hpp │ │ └── void_t.hpp │ ├── output │ │ ├── binary_writer.hpp │ │ ├── output_adapters.hpp │ │ └── serializer.hpp │ ├── string_concat.hpp │ ├── string_escape.hpp │ ├── string_utils.hpp │ └── value_t.hpp │ ├── json.hpp │ ├── json_fwd.hpp │ ├── ordered_map.hpp │ └── thirdparty │ └── hedley │ ├── hedley.hpp │ └── hedley_undef.hpp ├── pch.cpp ├── pch.h ├── res ├── SWTools.ico └── SWTools.rc2 ├── resource.h └── targetver.h /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/app-support-request---请求-app-支持.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: App-support request | 请求 app 支持 3 | about: 您希望 SWTools 添加什么 Steam App 的创意工坊下载支持? 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Steam App 名称 11 | 12 | *在这里写下你希望添加支持的 app 名称...* 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report---报告-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report | 报告 bug 3 | about: 报告程序中的问题,帮助我们改进 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Bug 描述 11 | 12 | *在这里写下对 bug 的清晰简洁的描述。* 13 | 14 | 15 | 16 | ### 复现步骤 17 | *在这里写下重现异常行为的步骤。* 18 | 19 | 20 | 21 | ### 屏幕截图 22 | 23 | *如果适用,请添加屏幕截图以帮助解释您的问题。* 24 | 25 | 26 | 27 | - 操作系统:*在此处填写...* 28 | - 程序版本:*在此处填写...* 29 | 30 | 31 | 32 | ### 附加信息 33 | 34 | *在此处添加有关该问题的任何其他信息。* 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd 364 | 365 | # Project-adapted 366 | steamcmd 367 | eula.txt 368 | version.txt 369 | workshops -------------------------------------------------------------------------------- /CManyDownload.cpp: -------------------------------------------------------------------------------- 1 | // CManyDownload.cpp: 实现文件 2 | // 3 | 4 | #include "pch.h" 5 | #include "SWTools.h" 6 | #include "afxdialogex.h" 7 | #include 8 | #include 9 | #include "CManyDownload.h" 10 | 11 | 12 | // CManyDownload 对话框 13 | 14 | IMPLEMENT_DYNAMIC(CManyDownload, CDialogEx) 15 | 16 | CManyDownload::CManyDownload(CWnd* pParent /*=nullptr*/) 17 | : CDialogEx(IDD_ManyDownload, pParent) 18 | { 19 | 20 | } 21 | 22 | CManyDownload::~CManyDownload() 23 | { 24 | } 25 | 26 | void CManyDownload::DoDataExchange(CDataExchange* pDX) 27 | { 28 | CDialogEx::DoDataExchange(pDX); 29 | DDX_Control(pDX, IDC_TEXT, Loading); 30 | DDX_Control(pDX, IDC_COMBO1, COMBO_Choose); 31 | } 32 | 33 | 34 | BEGIN_MESSAGE_MAP(CManyDownload, CDialogEx) 35 | ON_BN_CLICKED(IDC_MANYDWNLAUNCH, &CManyDownload::OnBnClickedManydwnlaunch) 36 | ON_CBN_SELCHANGE(IDC_COMBO1, &CManyDownload::OnCbnSelchangeCombo1) 37 | END_MESSAGE_MAP() 38 | 39 | 40 | // CManyDownload 消息处理程序 41 | 42 | void CManyDownload::OnBnClickedManydwnlaunch() { 43 | // 检查文件是否存在 44 | if (_access("./WorkshopsID.txt", 0) == -1) { 45 | MessageBox(TEXT("WorkshopsID.txt不存在!"), TEXT("提示"), MB_OK | MB_ICONWARNING); 46 | return; 47 | } 48 | 49 | // 检查steamcmd目录是否存在,不存在则创建并下载 50 | bool needSteamcmd = (_access("./steamcmd", 0) == -1); 51 | if (needSteamcmd) { 52 | CString Path = TEXT("steamcmd"); 53 | bool flag = CreateDirectory(Path, NULL); 54 | if (!flag) { 55 | MessageBox(TEXT("无法创建steamcmd目录,请检查权限!"), TEXT("错误"), MB_OK | MB_ICONERROR); 56 | return; 57 | } 58 | 59 | // 下载steamcmd.zip 60 | CString downloadCmd = TEXT("curl -s https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -o steamcmd.zip"); 61 | int downloadResult = system(CT2A(downloadCmd)); 62 | if (downloadResult != 0) { 63 | MessageBox(TEXT("下载steamcmd.zip失败,请检查网络连接!"), TEXT("错误"), MB_OK | MB_ICONERROR); 64 | return; 65 | } 66 | 67 | // 解压steamcmd.zip 68 | CString extractCmd = TEXT("tar -xf steamcmd.zip"); 69 | int extractResult = system(CT2A(extractCmd)); 70 | if (extractResult != 0) { 71 | MessageBox(TEXT("解压steamcmd.zip失败,请确保tar命令可用!"), TEXT("错误"), MB_OK | MB_ICONERROR); 72 | return; 73 | } 74 | } 75 | 76 | // 读取文件内容 77 | CString lines[128]; // 增大数组大小为128 78 | int lineCount = 0; 79 | CStdioFile file; 80 | 81 | // 打开文件并读取ID 82 | if (file.Open(TEXT("WorkshopsID.txt"), CFile::modeRead)) { 83 | CString line; 84 | while (lineCount < 128 && file.ReadString(line)) { 85 | // 跳过空行 86 | if (!line.IsEmpty()) 87 | lines[lineCount++] = line; 88 | } 89 | file.Close(); 90 | } 91 | else { 92 | MessageBox(TEXT("无法打开文件!"), TEXT("错误"), MB_OK | MB_ICONERROR); 93 | return; 94 | } 95 | 96 | if (lineCount == 0) { 97 | MessageBox(TEXT("文件中没有有效的ID!"), TEXT("提示"), MB_OK); 98 | return; 99 | } 100 | 101 | // 确认下载 102 | CString msg; 103 | msg.Format(TEXT("准备下载 %d 个创意工坊内容,是否继续?"), lineCount); 104 | if (MessageBox(msg, TEXT("确认下载"), MB_YESNO | MB_ICONQUESTION) != IDYES) 105 | return; 106 | 107 | // 获取当前程序路径,构建steamcmd绝对路径 108 | TCHAR szPath[MAX_PATH]; 109 | GetModuleFileName(NULL, szPath, MAX_PATH); 110 | PathRemoveFileSpec(szPath); 111 | CString steamcmdPath = CString(szPath) + TEXT("\\steamcmd\\"); 112 | 113 | // 执行批量下载 114 | int successCount = 0; 115 | int failedCount = 0; 116 | CString failedIDs; 117 | 118 | // 获取当前下拉框选择内容 119 | CString choose; 120 | COMBO_Choose.GetWindowText(choose); 121 | if (choose.IsEmpty()) 122 | { 123 | MessageBox(TEXT("请选择一个选项!"), TEXT("提示"), MB_OK | MB_ICONWARNING); 124 | } 125 | if (choose == "钢铁雄心4") { 126 | for (int i = 0; i < lineCount; i++) { 127 | // 更新进度显示 128 | msg.Format(TEXT("正在下载第 %d/%d 个: %s"), i + 1, lineCount, lines[i]); 129 | SetDlgItemText(IDC_TEXT, msg); 130 | UpdateWindow(); 131 | 132 | // 构建命令行 133 | CString command; 134 | command.Format( 135 | TEXT("cd /d \"%s\" && steamcmd.exe +login thb112259 steamok7416 +workshop_download_item %s +quit"), 136 | steamcmdPath, lines[i]); 137 | 138 | // 执行命令并获取结果 139 | int result = system(CT2A(command)); 140 | if (result != 0) { 141 | failedCount++; 142 | failedIDs += lines[i] + TEXT("\n"); 143 | msg.Format(TEXT("下载失败: %s"), lines[i]); 144 | MessageBox(msg, TEXT("下载错误"), MB_OK | MB_ICONERROR); 145 | } 146 | else { 147 | successCount++; 148 | } 149 | } 150 | } 151 | else if (choose == "都市天际线") { 152 | for (int i = 0; i < lineCount; i++) { 153 | msg.Format(TEXT("正在下载第 %d/%d 个: %s"), i + 1, lineCount, lines[i]); 154 | SetDlgItemText(IDC_TEXT, msg); 155 | UpdateWindow(); 156 | CString command; 157 | command.Format( 158 | TEXT("cd /d \"%s\" && steamcmd.exe +login thb112181 steamok123123 +workshop_download_item %s +quit"), 159 | steamcmdPath, lines[i]); 160 | int result = system(CT2A(command)); 161 | if (result != 0) { 162 | failedCount++; 163 | failedIDs += lines[i] + TEXT("\n"); 164 | msg.Format(TEXT("下载失败: %s"), lines[i]); 165 | MessageBox(msg, TEXT("下载错误"), MB_OK | MB_ICONERROR); 166 | } 167 | else { 168 | successCount++; 169 | } 170 | } 171 | } 172 | else if (choose == "盖瑞模组") { 173 | for (int i = 0; i < lineCount; i++) { 174 | msg.Format(TEXT("正在下载第 %d/%d 个: %s"), i + 1, lineCount, lines[i]); 175 | SetDlgItemText(IDC_TEXT, msg); 176 | UpdateWindow(); 177 | CString command; 178 | command.Format( 179 | TEXT("cd /d \"%s\" && steamcmd.exe +login anonymous +workshop_download_item %s +quit"), 180 | steamcmdPath, lines[i]); 181 | int result = system(CT2A(command)); 182 | if (result != 0) { 183 | failedCount++; 184 | failedIDs += lines[i] + TEXT("\n"); 185 | msg.Format(TEXT("下载失败: %s"), lines[i]); 186 | MessageBox(msg, TEXT("下载错误"), MB_OK | MB_ICONERROR); 187 | } 188 | else { 189 | successCount++; 190 | } 191 | } 192 | } 193 | 194 | else if (choose == "壁纸引擎") { 195 | for (int i = 0; i < lineCount; i++) { 196 | msg.Format(TEXT("正在下载第 %d/%d 个: %s"), i + 1, lineCount, lines[i]); 197 | SetDlgItemText(IDC_TEXT, msg); 198 | UpdateWindow(); 199 | CString command; 200 | command.Format( 201 | TEXT("cd /d \"%s\" && steamcmd.exe +login kzeon410 wmq69815I +workshop_download_item %s +quit"), 202 | steamcmdPath, lines[i]); 203 | int result = system(CT2A(command)); 204 | if (result != 0) { 205 | failedCount++; 206 | failedIDs += lines[i] + TEXT("\n"); 207 | msg.Format(TEXT("下载失败: %s"), lines[i]); 208 | MessageBox(msg, TEXT("下载错误"), MB_OK | MB_ICONERROR); 209 | } 210 | else { 211 | successCount++; 212 | } 213 | } 214 | } 215 | // 完成提示 216 | if (failedCount == 0) { 217 | MessageBox(TEXT("所有内容下载完成!"), TEXT("完成"), MB_OK | MB_ICONINFORMATION); 218 | } 219 | else { 220 | msg.Format(TEXT("下载完成!成功: %d,失败: %d\n\n失败的ID:\n%s"), 221 | successCount, failedCount, failedIDs); 222 | MessageBox(msg, TEXT("下载结果"), MB_OK | MB_ICONWARNING); 223 | } 224 | 225 | SetDlgItemText(IDC_TEXT, TEXT("下载已完成")); 226 | } 227 | void CManyDownload::OnCbnSelchangeCombo1() 228 | { 229 | // TODO: 在此添加控件通知处理程序代码 230 | } 231 | -------------------------------------------------------------------------------- /CManyDownload.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxdialogex.h" 3 | 4 | 5 | // CManyDownload 对话框 6 | 7 | class CManyDownload : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CManyDownload) 10 | 11 | public: 12 | CManyDownload(CWnd* pParent = nullptr); // 标准构造函数 13 | virtual ~CManyDownload(); 14 | 15 | // 对话框数据 16 | #ifdef AFX_DESIGN_TIME 17 | enum { IDD = IDD_ManyDownload }; 18 | #endif 19 | 20 | protected: 21 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 22 | 23 | DECLARE_MESSAGE_MAP() 24 | public: 25 | CStatic Loading; 26 | afx_msg void OnBnClickedManydwnlaunch(); 27 | CComboBox COMBO_Choose; 28 | afx_msg void OnCbnSelchangeCombo1(); 29 | }; 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 贡献指南 2 | 3 | 欢迎为本项目贡献一份力量! 4 | 5 | 下面介绍项目的实现方式,你可以选择一个擅长或者感兴趣的部分开发。 6 | 7 | ## 程序逻辑 8 | 9 | ```mermaid 10 | sequenceDiagram 11 | actor 用户 12 | box SWTools 13 | participant GUI as GUI线程(前端) 14 | participant Task as 任务线程(后端) 15 | end 16 | participant Steamcmd 17 | autonumber 18 | 用户->>+GUI: 请求下载 19 | GUI->>+Task: 提供下载信息
通知开始下载 20 | Note over Task: 检查 Steamcmd是否存在 21 | Task-->>Steamcmd: (下载 Steamcmd) 22 | Note over Task: 检索用于下载目标 App 的
用户名-密码 23 | Task->>+Steamcmd: 调用 24 | par 下载中 25 | Steamcmd-->>Task: 实时运行结果 26 | Task-->>GUI: 解析并显示 27 | end 28 | Note over Task, Steamcmd: 下载结束后立即终止Steamcmd进程 29 | Steamcmd->>-Task: 程序退出 30 | Task->>-GUI: 显示下载状态
(打开目标文件夹) 31 | Note right of Steamcmd: 通信方式 32 | Note over Task, Steamcmd: 匿名管道 33 | Note over GUI, Task: 互斥锁、共享内存 34 | ``` 35 | 36 | - GUI 采用的技术是 **MFC**(Visual C/C++)。 37 | - 后端相关代码全部放在 `backend/` 下(声明和实现不分离);下载一律用的是 `curl`。下面是部分文件的介绍: 38 | - `backend.hpp`:这是总头文件; 39 | - `app_info.hpp`:这里存储了用于登录不同 Steam App 的 *用户名-密码* 对信息; 40 | - `downloader.hpp`:这里是主下载逻辑; 41 | - `process.hpp`:这是一个包装器,用于调用 Steamcmd; 42 | -------------------------------------------------------------------------------- /CWorkshops_info.cpp: -------------------------------------------------------------------------------- 1 | // CWorkshops_info.cpp: 实现文件 2 | // 3 | 4 | #include "pch.h" 5 | #include "SWTools.h" 6 | #include "afxdialogex.h" 7 | #include "CWorkshops_info.h" 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | using json = nlohmann::json; 14 | // CWorkshops_info 对话框 15 | 16 | IMPLEMENT_DYNAMIC(CWorkshops_info, CDialogEx) 17 | 18 | BOOL CWorkshops_info::OnInitDialog() 19 | { 20 | CDialogEx::OnInitDialog(); 21 | // 检查Temp文件夹 22 | if (_access("./workshops", 0) == -1) 23 | { 24 | if (_mkdir("./workshops") == -1) { 25 | MessageBox(_T("无法创建临时文件夹,请检查权限"), _T("错误"), MB_ICONERROR | MB_OK); 26 | return FALSE; // 退出对话框 27 | } 28 | } 29 | system(command_curl.GetString()); 30 | if (_access(file_path, 0) == -1) { 31 | MessageBox(_T("无法下载物品信息,请检查网络连接"), _T("错误"), MB_ICONERROR | MB_OK); 32 | return FALSE; // 退出对话框 33 | } 34 | std::ifstream file(file_path); 35 | if (!file.is_open()) { 36 | MessageBox(_T("无法打开物品信息文件"), _T("错误"), MB_ICONERROR | MB_OK); 37 | return FALSE; // 退出对话框 38 | } 39 | 40 | 41 | // 读取JSON文件 42 | try 43 | { 44 | json j; 45 | file >> j; 46 | for (auto& element : j) { 47 | std::string nameStr = element["title"].get(); 48 | CString name(nameStr.c_str()); 49 | int followers = element["followers"].get(); 50 | CString followerstr; 51 | followerstr.Format(_T("%d"), followers); 52 | std::string app_name = element["app_name"].get(); 53 | CString appName(app_name.c_str()); 54 | int views = element["views"].get(); 55 | CString viewsStr; 56 | viewsStr.Format(_T("%d"), views); 57 | CString info; 58 | info.Format(_T("物品名称: %s\r\n物品关注: %s\r\n所属软件&游戏: %s\r\n浏览量: %s\r\n"),name.GetString(), followerstr.GetString(), appName.GetString(), viewsStr.GetString()); 59 | m_workshops_info.SetWindowTextW(info.GetString()); 60 | } 61 | } 62 | // 错误处理 63 | catch (const json::parse_error& e) 64 | { 65 | MessageBox(_T("JSON解析错误: ") + CString(e.what()), _T("错误"), MB_ICONERROR | MB_OK); 66 | return FALSE; 67 | } 68 | catch (const std::exception& e) 69 | { 70 | MessageBox(_T("发生异常: ") + CString(e.what()), _T("错误"), MB_ICONERROR | MB_OK); 71 | return FALSE; 72 | } 73 | return TRUE; 74 | } 75 | 76 | CWorkshops_info::CWorkshops_info(CWnd* pParent /*=nullptr*/) 77 | : CDialogEx(IDD_Workshops_info, pParent) 78 | { 79 | 80 | } 81 | 82 | CWorkshops_info::~CWorkshops_info() 83 | { 84 | } 85 | 86 | void CWorkshops_info::DoDataExchange(CDataExchange* pDX) 87 | { 88 | CDialogEx::DoDataExchange(pDX); 89 | DDX_Control(pDX, IDC_EDIT1, m_workshops_info); 90 | } 91 | 92 | 93 | BEGIN_MESSAGE_MAP(CWorkshops_info, CDialogEx) 94 | ON_EN_CHANGE(IDC_EDIT1, &CWorkshops_info::OnEnChangeEdit1) 95 | END_MESSAGE_MAP() 96 | 97 | 98 | // CWorkshops_info 消息处理程序 99 | 100 | void CWorkshops_info::OnEnChangeEdit1() 101 | { 102 | // TODO: 如果该控件是 RICHEDIT 控件,它将不 103 | // 发送此通知,除非重写 CDialogEx::OnInitDialog() 104 | // 函数并调用 CRichEditCtrl().SetEventMask(), 105 | // 同时将 ENM_CHANGE 标志“或”运算到掩码中。 106 | 107 | // TODO: 在此添加控件通知处理程序代码 108 | } 109 | -------------------------------------------------------------------------------- /CWorkshops_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxdialogex.h" 3 | 4 | 5 | // CWorkshops_info 对话框 6 | 7 | class CWorkshops_info : public CDialogEx 8 | { 9 | DECLARE_DYNAMIC(CWorkshops_info) 10 | 11 | public: 12 | CWorkshops_info(CWnd* pParent = nullptr); // 标准构造函数 13 | virtual ~CWorkshops_info(); 14 | CStringA workshops_id; // 物品 ID 15 | CStringA command_curl; // curl 命令 16 | CStringA file_path; // 文件路径 17 | virtual BOOL OnInitDialog(); 18 | // 对话框数据 19 | #ifdef AFX_DESIGN_TIME 20 | enum { IDD = IDD_Workshops_info }; 21 | #endif 22 | 23 | protected: 24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 25 | 26 | DECLARE_MESSAGE_MAP() 27 | public: 28 | CEdit m_workshops_info; 29 | afx_msg void OnEnChangeEdit1(); 30 | }; 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Steam Workshops Tools 创意工坊下载工具 2 | 3 | 4 | 这是一款下载steam创意工坊下载模组的工具 5 | 6 | 在 [Releases](https://github.com/King-zzk/Steam-Workshops-Tools-SWTools/releases) 下载最新版本即可使用。 7 | 8 | 如果你想要在此项目上做开发,请在这里查看[贡献指南](https://github.com/King-zzk/Steam-Workshops-Tools-SWTools/blob/master/CONTRIBUTING.md)。 9 | 10 | ## 支持的 Steam 游戏(Steam App) 11 | 12 | 13 | ***计划添加*** 14 | - Europa Universalis IV | 欧陆风云4 15 | - Company of Heroes 3 | 英雄连3 16 | 17 | --- 18 | 19 | ***已可使用*** 20 | - Crusader Kings III | 十字军之王3 21 | - Cities: Skylines | 天际线 22 | - Garry's Mod | 盖瑞模组 23 | - Hearts of Iron IV | 钢铁雄心4 24 | - Sid Meier’s Civilization VI | 文明6 25 | - Wallpaper Engine | 壁纸引擎 26 | 27 | ## 支持 28 | 如果你想要贡献代码可以参考[贡献指南](https://github.com/King-zzk/Steam-Workshops-Tools-SWTools/blob/master/CONTRIBUTING.md)。 29 | 30 | 或者你也可以捐赠任何一个有创意工坊游戏的**Steam游戏账号(我们不会把你的账号泄露出去)可以留下自己的名字** 31 | 32 | **邮箱:swtoolsMK@outlook.com** 33 | 34 | 35 | ## 声明 36 | 37 | 仅供学习参考,支持正版,禁止用任何商业用途! 38 | -------------------------------------------------------------------------------- /SWTools.cpp: -------------------------------------------------------------------------------- 1 |  2 | // SWTools.cpp: 定义应用程序的类行为。 3 | // 4 | 5 | #include "pch.h" 6 | #include "framework.h" 7 | #include "SWTools.h" 8 | #include "SWToolsDlg.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #endif 13 | 14 | 15 | // CSWToolsApp 16 | 17 | BEGIN_MESSAGE_MAP(CSWToolsApp, CWinApp) 18 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp) 19 | END_MESSAGE_MAP() 20 | 21 | 22 | // CSWToolsApp 构造 23 | 24 | CSWToolsApp::CSWToolsApp() { 25 | // 支持重新启动管理器 26 | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; 27 | 28 | // TODO: 在此处添加构造代码, 29 | // 将所有重要的初始化放置在 InitInstance 中 30 | } 31 | 32 | 33 | // 唯一的 CSWToolsApp 对象 34 | 35 | CSWToolsApp theApp; 36 | 37 | 38 | // CSWToolsApp 初始化 39 | 40 | BOOL CSWToolsApp::InitInstance() { 41 | // 如果应用程序存在以下情况,Windows XP 上需要 InitCommonControlsEx() 42 | // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, 43 | //则需要 InitCommonControlsEx()。 否则,将无法创建窗口。 44 | INITCOMMONCONTROLSEX InitCtrls; 45 | InitCtrls.dwSize = sizeof(InitCtrls); 46 | // 将它设置为包括所有要在应用程序中使用的 47 | // 公共控件类。 48 | InitCtrls.dwICC = ICC_WIN95_CLASSES; 49 | InitCommonControlsEx(&InitCtrls); 50 | 51 | CWinApp::InitInstance(); 52 | 53 | 54 | AfxEnableControlContainer(); 55 | 56 | // 创建 shell 管理器,以防对话框包含 57 | // 任何 shell 树视图控件或 shell 列表视图控件。 58 | CShellManager* pShellManager = new CShellManager; 59 | 60 | // 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题 61 | CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); 62 | 63 | // 标准初始化 64 | // 如果未使用这些功能并希望减小 65 | // 最终可执行文件的大小,则应移除下列 66 | // 不需要的特定初始化例程 67 | // 更改用于存储设置的注册表项 68 | // TODO: 应适当修改该字符串, 69 | // 例如修改为公司或组织名 70 | SetRegistryKey(_T("应用程序向导生成的本地应用程序")); 71 | 72 | CSWToolsDlg dlg; 73 | m_pMainWnd = &dlg; 74 | INT_PTR nResponse = dlg.DoModal(); 75 | if (nResponse == IDOK) { 76 | // TODO: 在此放置处理何时用 77 | // “确定”来关闭对话框的代码 78 | } else if (nResponse == IDCANCEL) { 79 | // TODO: 在此放置处理何时用 80 | // “取消”来关闭对话框的代码 81 | } else if (nResponse == -1) { 82 | TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n"); 83 | TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n"); 84 | } 85 | 86 | // 删除上面创建的 shell 管理器。 87 | if (pShellManager != nullptr) { 88 | delete pShellManager; 89 | } 90 | 91 | #if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS) 92 | ControlBarCleanUp(); 93 | #endif 94 | 95 | // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, 96 | // 而不是启动应用程序的消息泵。 97 | return FALSE; 98 | } 99 | 100 | -------------------------------------------------------------------------------- /SWTools.h: -------------------------------------------------------------------------------- 1 |  2 | // SWTools.h: PROJECT_NAME 应用程序的主头文件 3 | // 4 | 5 | #pragma once 6 | 7 | #ifndef __AFXWIN_H__ 8 | #error "在包含此文件之前包含 'pch.h' 以生成 PCH" 9 | #endif 10 | 11 | #include "resource.h" // 主符号 12 | 13 | 14 | // CSWToolsApp: 15 | // 有关此类的实现,请参阅 SWTools.cpp 16 | // 17 | 18 | class CSWToolsApp : public CWinApp 19 | { 20 | public: 21 | CSWToolsApp(); 22 | 23 | // 重写 24 | public: 25 | virtual BOOL InitInstance(); 26 | 27 | // 实现 28 | 29 | DECLARE_MESSAGE_MAP() 30 | }; 31 | 32 | extern CSWToolsApp theApp; 33 | -------------------------------------------------------------------------------- /SWTools.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/SWTools.rc -------------------------------------------------------------------------------- /SWTools.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35527.113 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SWTools", "SWTools.vcxproj", "{CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | Release-DLL|x64 = Release-DLL|x64 15 | Release-DLL|x86 = Release-DLL|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Debug|x64.ActiveCfg = Debug|x64 19 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Debug|x64.Build.0 = Debug|x64 20 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Debug|x86.ActiveCfg = Debug|Win32 21 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Debug|x86.Build.0 = Debug|Win32 22 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release|x64.ActiveCfg = Release|x64 23 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release|x64.Build.0 = Release|x64 24 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release|x86.ActiveCfg = Release|Win32 25 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release|x86.Build.0 = Release|Win32 26 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 27 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release-DLL|x64.Build.0 = Release-DLL|x64 28 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release-DLL|x86.ActiveCfg = Release-DLL|Win32 29 | {CFE2A09F-0DD6-4C90-93A0-E3F77FC21073}.Release-DLL|x86.Build.0 = Release-DLL|Win32 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {19B06D4C-CBD6-4FBD-BF03-87126ACC477A} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /SWTools.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {c1b730bf-af87-49a2-bf31-85faa6bb578f} 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件\后端 41 | 42 | 43 | 头文件\后端 44 | 45 | 46 | 头文件\后端 47 | 48 | 49 | 头文件\后端 50 | 51 | 52 | 头文件\后端 53 | 54 | 55 | 头文件\后端 56 | 57 | 58 | 头文件\后端 59 | 60 | 61 | 头文件 62 | 63 | 64 | 头文件 65 | 66 | 67 | 68 | 69 | 源文件 70 | 71 | 72 | 源文件 73 | 74 | 75 | 源文件 76 | 77 | 78 | 源文件 79 | 80 | 81 | 源文件 82 | 83 | 84 | 85 | 86 | 资源文件 87 | 88 | 89 | 90 | 91 | 资源文件 92 | 93 | 94 | 95 | 96 | 资源文件 97 | 98 | 99 | -------------------------------------------------------------------------------- /SWToolsDlg.h: -------------------------------------------------------------------------------- 1 |  2 | // SWToolsDlg.h: 头文件 3 | // 4 | 5 | #pragma once 6 | 7 | 8 | // CSWToolsDlg 对话框 9 | class CSWToolsDlg : public CDialogEx 10 | { 11 | // 构造 12 | public: 13 | CSWToolsDlg(CWnd* pParent = nullptr); // 标准构造函数 14 | ~CSWToolsDlg(); 15 | 16 | // 对话框数据 17 | #ifdef AFX_DESIGN_TIME 18 | enum { IDD = IDD_SWTOOLS_DIALOG }; 19 | #endif 20 | 21 | protected: 22 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 23 | 24 | 25 | // 实现 26 | protected: 27 | HICON m_hIcon; 28 | 29 | // 生成的消息映射函数 30 | virtual BOOL OnInitDialog(); 31 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 32 | afx_msg void OnPaint(); 33 | afx_msg HCURSOR OnQueryDragIcon(); 34 | DECLARE_MESSAGE_MAP() 35 | public: 36 | CComboBox m_cboAppName; 37 | CStatic m_txtAppSlt; 38 | CButton m_btnExit; 39 | afx_msg void OnBnClickedAboutbtn(); 40 | afx_msg void OnEnChangeEdit2(); 41 | CButton m_btnLaunch; 42 | CEdit m_edtID; 43 | CEdit m_dashboard; 44 | afx_msg void OnBnClickedExitbtn(); 45 | CEdit m_state; 46 | afx_msg void OnBnClickedUpdatebtn(); 47 | void appendToDashboard(CString str); // 往仪表盘追加信息 48 | 49 | void* downloader; // 后端接口~ 50 | afx_msg void OnBnClickedLaunchbtn(); 51 | afx_msg void OnBnClickedFolderbtn(); 52 | CStatic m_version; 53 | afx_msg void OnBnClickedManydwnbtn(); 54 | afx_msg void OnBnClickedManydwnbtn2(); 55 | }; 56 | -------------------------------------------------------------------------------- /backend/app_info.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/app_info.hpp -------------------------------------------------------------------------------- /backend/backend.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/backend.hpp -------------------------------------------------------------------------------- /backend/downloader.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/downloader.hpp -------------------------------------------------------------------------------- /backend/eula.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/eula.hpp -------------------------------------------------------------------------------- /backend/nlohmann/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2025 Niels Lohmann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /backend/nlohmann/adl_serializer.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | 20 | /// @sa https://json.nlohmann.me/api/adl_serializer/ 21 | template 22 | struct adl_serializer 23 | { 24 | /// @brief convert a JSON value to any value type 25 | /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 26 | template 27 | static auto from_json(BasicJsonType && j, TargetType& val) noexcept( 28 | noexcept(::nlohmann::from_json(std::forward(j), val))) 29 | -> decltype(::nlohmann::from_json(std::forward(j), val), void()) 30 | { 31 | ::nlohmann::from_json(std::forward(j), val); 32 | } 33 | 34 | /// @brief convert a JSON value to any value type 35 | /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 36 | template 37 | static auto from_json(BasicJsonType && j) noexcept( 38 | noexcept(::nlohmann::from_json(std::forward(j), detail::identity_tag {}))) 39 | -> decltype(::nlohmann::from_json(std::forward(j), detail::identity_tag {})) 40 | { 41 | return ::nlohmann::from_json(std::forward(j), detail::identity_tag {}); 42 | } 43 | 44 | /// @brief convert any value type to a JSON value 45 | /// @sa https://json.nlohmann.me/api/adl_serializer/to_json/ 46 | template 47 | static auto to_json(BasicJsonType& j, TargetType && val) noexcept( 48 | noexcept(::nlohmann::to_json(j, std::forward(val)))) 49 | -> decltype(::nlohmann::to_json(j, std::forward(val)), void()) 50 | { 51 | ::nlohmann::to_json(j, std::forward(val)); 52 | } 53 | }; 54 | 55 | NLOHMANN_JSON_NAMESPACE_END 56 | -------------------------------------------------------------------------------- /backend/nlohmann/byte_container_with_subtype.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // uint8_t, uint64_t 12 | #include // tie 13 | #include // move 14 | 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | 19 | /// @brief an internal type for a backed binary type 20 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/ 21 | template 22 | class byte_container_with_subtype : public BinaryType 23 | { 24 | public: 25 | using container_type = BinaryType; 26 | using subtype_type = std::uint64_t; 27 | 28 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 29 | byte_container_with_subtype() noexcept(noexcept(container_type())) 30 | : container_type() 31 | {} 32 | 33 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 34 | byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b))) 35 | : container_type(b) 36 | {} 37 | 38 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 39 | byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b)))) 40 | : container_type(std::move(b)) 41 | {} 42 | 43 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 44 | byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b))) 45 | : container_type(b) 46 | , m_subtype(subtype_) 47 | , m_has_subtype(true) 48 | {} 49 | 50 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 51 | byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b)))) 52 | : container_type(std::move(b)) 53 | , m_subtype(subtype_) 54 | , m_has_subtype(true) 55 | {} 56 | 57 | bool operator==(const byte_container_with_subtype& rhs) const 58 | { 59 | return std::tie(static_cast(*this), m_subtype, m_has_subtype) == 60 | std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype); 61 | } 62 | 63 | bool operator!=(const byte_container_with_subtype& rhs) const 64 | { 65 | return !(rhs == *this); 66 | } 67 | 68 | /// @brief sets the binary subtype 69 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/set_subtype/ 70 | void set_subtype(subtype_type subtype_) noexcept 71 | { 72 | m_subtype = subtype_; 73 | m_has_subtype = true; 74 | } 75 | 76 | /// @brief return the binary subtype 77 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/subtype/ 78 | constexpr subtype_type subtype() const noexcept 79 | { 80 | return m_has_subtype ? m_subtype : static_cast(-1); 81 | } 82 | 83 | /// @brief return whether the value has a subtype 84 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/has_subtype/ 85 | constexpr bool has_subtype() const noexcept 86 | { 87 | return m_has_subtype; 88 | } 89 | 90 | /// @brief clears the binary subtype 91 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/clear_subtype/ 92 | void clear_subtype() noexcept 93 | { 94 | m_subtype = 0; 95 | m_has_subtype = false; 96 | } 97 | 98 | private: 99 | subtype_type m_subtype = 0; 100 | bool m_has_subtype = false; 101 | }; 102 | 103 | NLOHMANN_JSON_NAMESPACE_END 104 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/abi_macros.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | // This file contains all macro definitions affecting or depending on the ABI 12 | 13 | #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK 14 | #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) 15 | #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 16 | #warning "Already included a different version of the library!" 17 | #endif 18 | #endif 19 | #endif 20 | 21 | #define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) 22 | #define NLOHMANN_JSON_VERSION_MINOR 12 // NOLINT(modernize-macro-to-enum) 23 | #define NLOHMANN_JSON_VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) 24 | 25 | #ifndef JSON_DIAGNOSTICS 26 | #define JSON_DIAGNOSTICS 0 27 | #endif 28 | 29 | #ifndef JSON_DIAGNOSTIC_POSITIONS 30 | #define JSON_DIAGNOSTIC_POSITIONS 0 31 | #endif 32 | 33 | #ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 34 | #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 35 | #endif 36 | 37 | #if JSON_DIAGNOSTICS 38 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag 39 | #else 40 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS 41 | #endif 42 | 43 | #if JSON_DIAGNOSTIC_POSITIONS 44 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS _dp 45 | #else 46 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS 47 | #endif 48 | 49 | #if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 50 | #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp 51 | #else 52 | #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON 53 | #endif 54 | 55 | #ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION 56 | #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 57 | #endif 58 | 59 | // Construct the namespace ABI tags component 60 | #define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c 61 | #define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ 62 | NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) 63 | 64 | #define NLOHMANN_JSON_ABI_TAGS \ 65 | NLOHMANN_JSON_ABI_TAGS_CONCAT( \ 66 | NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ 67 | NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ 68 | NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) 69 | 70 | // Construct the namespace version component 71 | #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ 72 | _v ## major ## _ ## minor ## _ ## patch 73 | #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ 74 | NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) 75 | 76 | #if NLOHMANN_JSON_NAMESPACE_NO_VERSION 77 | #define NLOHMANN_JSON_NAMESPACE_VERSION 78 | #else 79 | #define NLOHMANN_JSON_NAMESPACE_VERSION \ 80 | NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ 81 | NLOHMANN_JSON_VERSION_MINOR, \ 82 | NLOHMANN_JSON_VERSION_PATCH) 83 | #endif 84 | 85 | // Combine namespace components 86 | #define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b 87 | #define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ 88 | NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) 89 | 90 | #ifndef NLOHMANN_JSON_NAMESPACE 91 | #define NLOHMANN_JSON_NAMESPACE \ 92 | nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ 93 | NLOHMANN_JSON_ABI_TAGS, \ 94 | NLOHMANN_JSON_NAMESPACE_VERSION) 95 | #endif 96 | 97 | #ifndef NLOHMANN_JSON_NAMESPACE_BEGIN 98 | #define NLOHMANN_JSON_NAMESPACE_BEGIN \ 99 | namespace nlohmann \ 100 | { \ 101 | inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ 102 | NLOHMANN_JSON_ABI_TAGS, \ 103 | NLOHMANN_JSON_NAMESPACE_VERSION) \ 104 | { 105 | #endif 106 | 107 | #ifndef NLOHMANN_JSON_NAMESPACE_END 108 | #define NLOHMANN_JSON_NAMESPACE_END \ 109 | } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ 110 | } // namespace nlohmann 111 | #endif 112 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/hash.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // uint8_t 12 | #include // size_t 13 | #include // hash 14 | 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | namespace detail 20 | { 21 | 22 | // boost::hash_combine 23 | inline std::size_t combine(std::size_t seed, std::size_t h) noexcept 24 | { 25 | seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U); 26 | return seed; 27 | } 28 | 29 | /*! 30 | @brief hash a JSON value 31 | 32 | The hash function tries to rely on std::hash where possible. Furthermore, the 33 | type of the JSON value is taken into account to have different hash values for 34 | null, 0, 0U, and false, etc. 35 | 36 | @tparam BasicJsonType basic_json specialization 37 | @param j JSON value to hash 38 | @return hash value of j 39 | */ 40 | template 41 | std::size_t hash(const BasicJsonType& j) 42 | { 43 | using string_t = typename BasicJsonType::string_t; 44 | using number_integer_t = typename BasicJsonType::number_integer_t; 45 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 46 | using number_float_t = typename BasicJsonType::number_float_t; 47 | 48 | const auto type = static_cast(j.type()); 49 | switch (j.type()) 50 | { 51 | case BasicJsonType::value_t::null: 52 | case BasicJsonType::value_t::discarded: 53 | { 54 | return combine(type, 0); 55 | } 56 | 57 | case BasicJsonType::value_t::object: 58 | { 59 | auto seed = combine(type, j.size()); 60 | for (const auto& element : j.items()) 61 | { 62 | const auto h = std::hash {}(element.key()); 63 | seed = combine(seed, h); 64 | seed = combine(seed, hash(element.value())); 65 | } 66 | return seed; 67 | } 68 | 69 | case BasicJsonType::value_t::array: 70 | { 71 | auto seed = combine(type, j.size()); 72 | for (const auto& element : j) 73 | { 74 | seed = combine(seed, hash(element)); 75 | } 76 | return seed; 77 | } 78 | 79 | case BasicJsonType::value_t::string: 80 | { 81 | const auto h = std::hash {}(j.template get_ref()); 82 | return combine(type, h); 83 | } 84 | 85 | case BasicJsonType::value_t::boolean: 86 | { 87 | const auto h = std::hash {}(j.template get()); 88 | return combine(type, h); 89 | } 90 | 91 | case BasicJsonType::value_t::number_integer: 92 | { 93 | const auto h = std::hash {}(j.template get()); 94 | return combine(type, h); 95 | } 96 | 97 | case BasicJsonType::value_t::number_unsigned: 98 | { 99 | const auto h = std::hash {}(j.template get()); 100 | return combine(type, h); 101 | } 102 | 103 | case BasicJsonType::value_t::number_float: 104 | { 105 | const auto h = std::hash {}(j.template get()); 106 | return combine(type, h); 107 | } 108 | 109 | case BasicJsonType::value_t::binary: 110 | { 111 | auto seed = combine(type, j.get_binary().size()); 112 | const auto h = std::hash {}(j.get_binary().has_subtype()); 113 | seed = combine(seed, h); 114 | seed = combine(seed, static_cast(j.get_binary().subtype())); 115 | for (const auto byte : j.get_binary()) 116 | { 117 | seed = combine(seed, std::hash {}(byte)); 118 | } 119 | return seed; 120 | } 121 | 122 | default: // LCOV_EXCL_LINE 123 | JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE 124 | return 0; // LCOV_EXCL_LINE 125 | } 126 | } 127 | 128 | } // namespace detail 129 | NLOHMANN_JSON_NAMESPACE_END 130 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/input/position_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | /// struct to capture the start position of the current token 20 | struct position_t 21 | { 22 | /// the total number of characters read 23 | std::size_t chars_read_total = 0; 24 | /// the number of characters read in the current line 25 | std::size_t chars_read_current_line = 0; 26 | /// the number of lines read 27 | std::size_t lines_read = 0; 28 | 29 | /// conversion to size_t to preserve SAX interface 30 | constexpr operator size_t() const 31 | { 32 | return chars_read_total; 33 | } 34 | }; 35 | 36 | } // namespace detail 37 | NLOHMANN_JSON_NAMESPACE_END 38 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/iterators/internal_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | NLOHMANN_JSON_NAMESPACE_BEGIN 15 | namespace detail 16 | { 17 | 18 | /*! 19 | @brief an iterator value 20 | 21 | @note This structure could easily be a union, but MSVC currently does not allow 22 | unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. 23 | */ 24 | template struct internal_iterator 25 | { 26 | /// iterator for JSON objects 27 | typename BasicJsonType::object_t::iterator object_iterator {}; 28 | /// iterator for JSON arrays 29 | typename BasicJsonType::array_t::iterator array_iterator {}; 30 | /// generic iterator for all other types 31 | primitive_iterator_t primitive_iterator {}; 32 | }; 33 | 34 | } // namespace detail 35 | NLOHMANN_JSON_NAMESPACE_END 36 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/iterators/iteration_proxy.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | #include // forward_iterator_tag 13 | #include // tuple_size, get, tuple_element 14 | #include // move 15 | 16 | #if JSON_HAS_RANGES 17 | #include // enable_borrowed_range 18 | #endif 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | NLOHMANN_JSON_NAMESPACE_BEGIN 26 | namespace detail 27 | { 28 | 29 | template class iteration_proxy_value 30 | { 31 | public: 32 | using difference_type = std::ptrdiff_t; 33 | using value_type = iteration_proxy_value; 34 | using pointer = value_type *; 35 | using reference = value_type &; 36 | using iterator_category = std::forward_iterator_tag; 37 | using string_type = typename std::remove_cv< typename std::remove_reference().key() ) >::type >::type; 38 | 39 | private: 40 | /// the iterator 41 | IteratorType anchor{}; 42 | /// an index for arrays (used to create key names) 43 | std::size_t array_index = 0; 44 | /// last stringified array index 45 | mutable std::size_t array_index_last = 0; 46 | /// a string representation of the array index 47 | mutable string_type array_index_str = "0"; 48 | /// an empty string (to return a reference for primitive values) 49 | string_type empty_str{}; 50 | 51 | public: 52 | explicit iteration_proxy_value() = default; 53 | explicit iteration_proxy_value(IteratorType it, std::size_t array_index_ = 0) 54 | noexcept(std::is_nothrow_move_constructible::value 55 | && std::is_nothrow_default_constructible::value) 56 | : anchor(std::move(it)) 57 | , array_index(array_index_) 58 | {} 59 | 60 | iteration_proxy_value(iteration_proxy_value const&) = default; 61 | iteration_proxy_value& operator=(iteration_proxy_value const&) = default; 62 | // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions 63 | iteration_proxy_value(iteration_proxy_value&&) 64 | noexcept(std::is_nothrow_move_constructible::value 65 | && std::is_nothrow_move_constructible::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) 66 | iteration_proxy_value& operator=(iteration_proxy_value&&) 67 | noexcept(std::is_nothrow_move_assignable::value 68 | && std::is_nothrow_move_assignable::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) 69 | ~iteration_proxy_value() = default; 70 | 71 | /// dereference operator (needed for range-based for) 72 | const iteration_proxy_value& operator*() const 73 | { 74 | return *this; 75 | } 76 | 77 | /// increment operator (needed for range-based for) 78 | iteration_proxy_value& operator++() 79 | { 80 | ++anchor; 81 | ++array_index; 82 | 83 | return *this; 84 | } 85 | 86 | iteration_proxy_value operator++(int)& // NOLINT(cert-dcl21-cpp) 87 | { 88 | auto tmp = iteration_proxy_value(anchor, array_index); 89 | ++anchor; 90 | ++array_index; 91 | return tmp; 92 | } 93 | 94 | /// equality operator (needed for InputIterator) 95 | bool operator==(const iteration_proxy_value& o) const 96 | { 97 | return anchor == o.anchor; 98 | } 99 | 100 | /// inequality operator (needed for range-based for) 101 | bool operator!=(const iteration_proxy_value& o) const 102 | { 103 | return anchor != o.anchor; 104 | } 105 | 106 | /// return key of the iterator 107 | const string_type& key() const 108 | { 109 | JSON_ASSERT(anchor.m_object != nullptr); 110 | 111 | switch (anchor.m_object->type()) 112 | { 113 | // use integer array index as key 114 | case value_t::array: 115 | { 116 | if (array_index != array_index_last) 117 | { 118 | int_to_string( array_index_str, array_index ); 119 | array_index_last = array_index; 120 | } 121 | return array_index_str; 122 | } 123 | 124 | // use key from the object 125 | case value_t::object: 126 | return anchor.key(); 127 | 128 | // use an empty key for all primitive types 129 | case value_t::null: 130 | case value_t::string: 131 | case value_t::boolean: 132 | case value_t::number_integer: 133 | case value_t::number_unsigned: 134 | case value_t::number_float: 135 | case value_t::binary: 136 | case value_t::discarded: 137 | default: 138 | return empty_str; 139 | } 140 | } 141 | 142 | /// return value of the iterator 143 | typename IteratorType::reference value() const 144 | { 145 | return anchor.value(); 146 | } 147 | }; 148 | 149 | /// proxy class for the items() function 150 | template class iteration_proxy 151 | { 152 | private: 153 | /// the container to iterate 154 | typename IteratorType::pointer container = nullptr; 155 | 156 | public: 157 | explicit iteration_proxy() = default; 158 | 159 | /// construct iteration proxy from a container 160 | explicit iteration_proxy(typename IteratorType::reference cont) noexcept 161 | : container(&cont) {} 162 | 163 | iteration_proxy(iteration_proxy const&) = default; 164 | iteration_proxy& operator=(iteration_proxy const&) = default; 165 | iteration_proxy(iteration_proxy&&) noexcept = default; 166 | iteration_proxy& operator=(iteration_proxy&&) noexcept = default; 167 | ~iteration_proxy() = default; 168 | 169 | /// return iterator begin (needed for range-based for) 170 | iteration_proxy_value begin() const noexcept 171 | { 172 | return iteration_proxy_value(container->begin()); 173 | } 174 | 175 | /// return iterator end (needed for range-based for) 176 | iteration_proxy_value end() const noexcept 177 | { 178 | return iteration_proxy_value(container->end()); 179 | } 180 | }; 181 | 182 | // Structured Bindings Support 183 | // For further reference see https://blog.tartanllama.xyz/structured-bindings/ 184 | // And see https://github.com/nlohmann/json/pull/1391 185 | template = 0> 186 | auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.key()) 187 | { 188 | return i.key(); 189 | } 190 | // Structured Bindings Support 191 | // For further reference see https://blog.tartanllama.xyz/structured-bindings/ 192 | // And see https://github.com/nlohmann/json/pull/1391 193 | template = 0> 194 | auto get(const nlohmann::detail::iteration_proxy_value& i) -> decltype(i.value()) 195 | { 196 | return i.value(); 197 | } 198 | 199 | } // namespace detail 200 | NLOHMANN_JSON_NAMESPACE_END 201 | 202 | // The Addition to the STD Namespace is required to add 203 | // Structured Bindings Support to the iteration_proxy_value class 204 | // For further reference see https://blog.tartanllama.xyz/structured-bindings/ 205 | // And see https://github.com/nlohmann/json/pull/1391 206 | namespace std 207 | { 208 | 209 | #if defined(__clang__) 210 | // Fix: https://github.com/nlohmann/json/issues/1401 211 | #pragma clang diagnostic push 212 | #pragma clang diagnostic ignored "-Wmismatched-tags" 213 | #endif 214 | template 215 | class tuple_size<::nlohmann::detail::iteration_proxy_value> // NOLINT(cert-dcl58-cpp) 216 | : public std::integral_constant {}; 217 | 218 | template 219 | class tuple_element> // NOLINT(cert-dcl58-cpp) 220 | { 221 | public: 222 | using type = decltype( 223 | get(std::declval < 224 | ::nlohmann::detail::iteration_proxy_value> ())); 225 | }; 226 | #if defined(__clang__) 227 | #pragma clang diagnostic pop 228 | #endif 229 | 230 | } // namespace std 231 | 232 | #if JSON_HAS_RANGES 233 | template 234 | inline constexpr bool ::std::ranges::enable_borrowed_range<::nlohmann::detail::iteration_proxy> = true; 235 | #endif 236 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/iterators/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // random_access_iterator_tag 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | template 22 | struct iterator_types {}; 23 | 24 | template 25 | struct iterator_types < 26 | It, 27 | void_t> 29 | { 30 | using difference_type = typename It::difference_type; 31 | using value_type = typename It::value_type; 32 | using pointer = typename It::pointer; 33 | using reference = typename It::reference; 34 | using iterator_category = typename It::iterator_category; 35 | }; 36 | 37 | // This is required as some compilers implement std::iterator_traits in a way that 38 | // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. 39 | template 40 | struct iterator_traits 41 | { 42 | }; 43 | 44 | template 45 | struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> 46 | : iterator_types 47 | { 48 | }; 49 | 50 | template 51 | struct iterator_traits::value>> 52 | { 53 | using iterator_category = std::random_access_iterator_tag; 54 | using value_type = T; 55 | using difference_type = ptrdiff_t; 56 | using pointer = T*; 57 | using reference = T&; 58 | }; 59 | 60 | } // namespace detail 61 | NLOHMANN_JSON_NAMESPACE_END 62 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/iterators/json_reverse_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // ptrdiff_t 12 | #include // reverse_iterator 13 | #include // declval 14 | 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | ////////////////////// 22 | // reverse_iterator // 23 | ////////////////////// 24 | 25 | /*! 26 | @brief a template for a reverse iterator class 27 | 28 | @tparam Base the base iterator type to reverse. Valid types are @ref 29 | iterator (to create @ref reverse_iterator) and @ref const_iterator (to 30 | create @ref const_reverse_iterator). 31 | 32 | @requirement The class satisfies the following concept requirements: 33 | - 34 | [BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): 35 | The iterator that can be moved can be moved in both directions (i.e. 36 | incremented and decremented). 37 | - [OutputIterator](https://en.cppreference.com/w/cpp/named_req/OutputIterator): 38 | It is possible to write to the pointed-to element (only if @a Base is 39 | @ref iterator). 40 | 41 | @since version 1.0.0 42 | */ 43 | template 44 | class json_reverse_iterator : public std::reverse_iterator 45 | { 46 | public: 47 | using difference_type = std::ptrdiff_t; 48 | /// shortcut to the reverse iterator adapter 49 | using base_iterator = std::reverse_iterator; 50 | /// the reference type for the pointed-to element 51 | using reference = typename Base::reference; 52 | 53 | /// create reverse iterator from iterator 54 | explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept 55 | : base_iterator(it) {} 56 | 57 | /// create reverse iterator from base class 58 | explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} 59 | 60 | /// post-increment (it++) 61 | json_reverse_iterator operator++(int)& // NOLINT(cert-dcl21-cpp) 62 | { 63 | return static_cast(base_iterator::operator++(1)); 64 | } 65 | 66 | /// pre-increment (++it) 67 | json_reverse_iterator& operator++() 68 | { 69 | return static_cast(base_iterator::operator++()); 70 | } 71 | 72 | /// post-decrement (it--) 73 | json_reverse_iterator operator--(int)& // NOLINT(cert-dcl21-cpp) 74 | { 75 | return static_cast(base_iterator::operator--(1)); 76 | } 77 | 78 | /// pre-decrement (--it) 79 | json_reverse_iterator& operator--() 80 | { 81 | return static_cast(base_iterator::operator--()); 82 | } 83 | 84 | /// add to iterator 85 | json_reverse_iterator& operator+=(difference_type i) 86 | { 87 | return static_cast(base_iterator::operator+=(i)); 88 | } 89 | 90 | /// add to iterator 91 | json_reverse_iterator operator+(difference_type i) const 92 | { 93 | return static_cast(base_iterator::operator+(i)); 94 | } 95 | 96 | /// subtract from iterator 97 | json_reverse_iterator operator-(difference_type i) const 98 | { 99 | return static_cast(base_iterator::operator-(i)); 100 | } 101 | 102 | /// return difference 103 | difference_type operator-(const json_reverse_iterator& other) const 104 | { 105 | return base_iterator(*this) - base_iterator(other); 106 | } 107 | 108 | /// access to successor 109 | reference operator[](difference_type n) const 110 | { 111 | return *(this->operator+(n)); 112 | } 113 | 114 | /// return the key of an object iterator 115 | auto key() const -> decltype(std::declval().key()) 116 | { 117 | auto it = --this->base(); 118 | return it.key(); 119 | } 120 | 121 | /// return the value of an iterator 122 | reference value() const 123 | { 124 | auto it = --this->base(); 125 | return it.operator * (); 126 | } 127 | }; 128 | 129 | } // namespace detail 130 | NLOHMANN_JSON_NAMESPACE_END 131 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/iterators/primitive_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // ptrdiff_t 12 | #include // numeric_limits 13 | 14 | #include 15 | 16 | NLOHMANN_JSON_NAMESPACE_BEGIN 17 | namespace detail 18 | { 19 | 20 | /* 21 | @brief an iterator for primitive JSON types 22 | 23 | This class models an iterator for primitive JSON types (boolean, number, 24 | string). It's only purpose is to allow the iterator/const_iterator classes 25 | to "iterate" over primitive values. Internally, the iterator is modeled by 26 | a `difference_type` variable. Value begin_value (`0`) models the begin, 27 | end_value (`1`) models past the end. 28 | */ 29 | class primitive_iterator_t 30 | { 31 | private: 32 | using difference_type = std::ptrdiff_t; 33 | static constexpr difference_type begin_value = 0; 34 | static constexpr difference_type end_value = begin_value + 1; 35 | 36 | JSON_PRIVATE_UNLESS_TESTED: 37 | /// iterator as signed integer type 38 | difference_type m_it = (std::numeric_limits::min)(); 39 | 40 | public: 41 | constexpr difference_type get_value() const noexcept 42 | { 43 | return m_it; 44 | } 45 | 46 | /// set iterator to a defined beginning 47 | void set_begin() noexcept 48 | { 49 | m_it = begin_value; 50 | } 51 | 52 | /// set iterator to a defined past the end 53 | void set_end() noexcept 54 | { 55 | m_it = end_value; 56 | } 57 | 58 | /// return whether the iterator can be dereferenced 59 | constexpr bool is_begin() const noexcept 60 | { 61 | return m_it == begin_value; 62 | } 63 | 64 | /// return whether the iterator is at end 65 | constexpr bool is_end() const noexcept 66 | { 67 | return m_it == end_value; 68 | } 69 | 70 | friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 71 | { 72 | return lhs.m_it == rhs.m_it; 73 | } 74 | 75 | friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 76 | { 77 | return lhs.m_it < rhs.m_it; 78 | } 79 | 80 | primitive_iterator_t operator+(difference_type n) noexcept 81 | { 82 | auto result = *this; 83 | result += n; 84 | return result; 85 | } 86 | 87 | friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 88 | { 89 | return lhs.m_it - rhs.m_it; 90 | } 91 | 92 | primitive_iterator_t& operator++() noexcept 93 | { 94 | ++m_it; 95 | return *this; 96 | } 97 | 98 | primitive_iterator_t operator++(int)& noexcept // NOLINT(cert-dcl21-cpp) 99 | { 100 | auto result = *this; 101 | ++m_it; 102 | return result; 103 | } 104 | 105 | primitive_iterator_t& operator--() noexcept 106 | { 107 | --m_it; 108 | return *this; 109 | } 110 | 111 | primitive_iterator_t operator--(int)& noexcept // NOLINT(cert-dcl21-cpp) 112 | { 113 | auto result = *this; 114 | --m_it; 115 | return result; 116 | } 117 | 118 | primitive_iterator_t& operator+=(difference_type n) noexcept 119 | { 120 | m_it += n; 121 | return *this; 122 | } 123 | 124 | primitive_iterator_t& operator-=(difference_type n) noexcept 125 | { 126 | m_it -= n; 127 | return *this; 128 | } 129 | }; 130 | 131 | } // namespace detail 132 | NLOHMANN_JSON_NAMESPACE_END 133 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/json_custom_base_class.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // conditional, is_same 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | /*! 20 | @brief Default base class of the @ref basic_json class. 21 | 22 | So that the correct implementations of the copy / move ctors / assign operators 23 | of @ref basic_json do not require complex case distinctions 24 | (no base class / custom base class used as customization point), 25 | @ref basic_json always has a base class. 26 | By default, this class is used because it is empty and thus has no effect 27 | on the behavior of @ref basic_json. 28 | */ 29 | struct json_default_base {}; 30 | 31 | template 32 | using json_base_class = typename std::conditional < 33 | std::is_same::value, 34 | json_default_base, 35 | T 36 | >::type; 37 | 38 | } // namespace detail 39 | NLOHMANN_JSON_NAMESPACE_END 40 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/json_ref.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | template 22 | class json_ref 23 | { 24 | public: 25 | using value_type = BasicJsonType; 26 | 27 | json_ref(value_type&& value) 28 | : owned_value(std::move(value)) 29 | {} 30 | 31 | json_ref(const value_type& value) 32 | : value_ref(&value) 33 | {} 34 | 35 | json_ref(std::initializer_list init) 36 | : owned_value(init) 37 | {} 38 | 39 | template < 40 | class... Args, 41 | enable_if_t::value, int> = 0 > 42 | json_ref(Args && ... args) 43 | : owned_value(std::forward(args)...) 44 | {} 45 | 46 | // class should be movable only 47 | json_ref(json_ref&&) noexcept = default; 48 | json_ref(const json_ref&) = delete; 49 | json_ref& operator=(const json_ref&) = delete; 50 | json_ref& operator=(json_ref&&) = delete; 51 | ~json_ref() = default; 52 | 53 | value_type moved_or_copied() const 54 | { 55 | if (value_ref == nullptr) 56 | { 57 | return std::move(owned_value); 58 | } 59 | return *value_ref; 60 | } 61 | 62 | value_type const& operator*() const 63 | { 64 | return value_ref ? *value_ref : owned_value; 65 | } 66 | 67 | value_type const* operator->() const 68 | { 69 | return &** this; 70 | } 71 | 72 | private: 73 | mutable value_type owned_value = nullptr; 74 | value_type const* value_ref = nullptr; 75 | }; 76 | 77 | } // namespace detail 78 | NLOHMANN_JSON_NAMESPACE_END 79 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/macro_unscope.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | // restore clang diagnostic settings 12 | #if defined(__clang__) 13 | #pragma clang diagnostic pop 14 | #endif 15 | 16 | // clean up 17 | #undef JSON_ASSERT 18 | #undef JSON_INTERNAL_CATCH 19 | #undef JSON_THROW 20 | #undef JSON_PRIVATE_UNLESS_TESTED 21 | #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION 22 | #undef NLOHMANN_BASIC_JSON_TPL 23 | #undef JSON_EXPLICIT 24 | #undef NLOHMANN_CAN_CALL_STD_FUNC_IMPL 25 | #undef JSON_INLINE_VARIABLE 26 | #undef JSON_NO_UNIQUE_ADDRESS 27 | #undef JSON_DISABLE_ENUM_SERIALIZATION 28 | #undef JSON_USE_GLOBAL_UDLS 29 | 30 | #ifndef JSON_TEST_KEEP_MACROS 31 | #undef JSON_CATCH 32 | #undef JSON_TRY 33 | #undef JSON_HAS_CPP_11 34 | #undef JSON_HAS_CPP_14 35 | #undef JSON_HAS_CPP_17 36 | #undef JSON_HAS_CPP_20 37 | #undef JSON_HAS_CPP_23 38 | #undef JSON_HAS_FILESYSTEM 39 | #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM 40 | #undef JSON_HAS_THREE_WAY_COMPARISON 41 | #undef JSON_HAS_RANGES 42 | #undef JSON_HAS_STATIC_RTTI 43 | #undef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 44 | #endif 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/call_std/begin.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/call_std/end.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/cpp_future.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-FileCopyrightText: 2018 The Abseil Authors 8 | // SPDX-License-Identifier: MIT 9 | 10 | #pragma once 11 | 12 | #include // array 13 | #include // size_t 14 | #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type 15 | #include // index_sequence, make_index_sequence, index_sequence_for 16 | 17 | #include 18 | 19 | NLOHMANN_JSON_NAMESPACE_BEGIN 20 | namespace detail 21 | { 22 | 23 | template 24 | using uncvref_t = typename std::remove_cv::type>::type; 25 | 26 | #ifdef JSON_HAS_CPP_14 27 | 28 | // the following utilities are natively available in C++14 29 | using std::enable_if_t; 30 | using std::index_sequence; 31 | using std::make_index_sequence; 32 | using std::index_sequence_for; 33 | 34 | #else 35 | 36 | // alias templates to reduce boilerplate 37 | template 38 | using enable_if_t = typename std::enable_if::type; 39 | 40 | // The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h 41 | // which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. 42 | 43 | //// START OF CODE FROM GOOGLE ABSEIL 44 | 45 | // integer_sequence 46 | // 47 | // Class template representing a compile-time integer sequence. An instantiation 48 | // of `integer_sequence` has a sequence of integers encoded in its 49 | // type through its template arguments (which is a common need when 50 | // working with C++11 variadic templates). `absl::integer_sequence` is designed 51 | // to be a drop-in replacement for C++14's `std::integer_sequence`. 52 | // 53 | // Example: 54 | // 55 | // template< class T, T... Ints > 56 | // void user_function(integer_sequence); 57 | // 58 | // int main() 59 | // { 60 | // // user_function's `T` will be deduced to `int` and `Ints...` 61 | // // will be deduced to `0, 1, 2, 3, 4`. 62 | // user_function(make_integer_sequence()); 63 | // } 64 | template 65 | struct integer_sequence 66 | { 67 | using value_type = T; 68 | static constexpr std::size_t size() noexcept 69 | { 70 | return sizeof...(Ints); 71 | } 72 | }; 73 | 74 | // index_sequence 75 | // 76 | // A helper template for an `integer_sequence` of `size_t`, 77 | // `absl::index_sequence` is designed to be a drop-in replacement for C++14's 78 | // `std::index_sequence`. 79 | template 80 | using index_sequence = integer_sequence; 81 | 82 | namespace utility_internal 83 | { 84 | 85 | template 86 | struct Extend; 87 | 88 | // Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. 89 | template 90 | struct Extend, SeqSize, 0> 91 | { 92 | using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; 93 | }; 94 | 95 | template 96 | struct Extend, SeqSize, 1> 97 | { 98 | using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; 99 | }; 100 | 101 | // Recursion helper for 'make_integer_sequence'. 102 | // 'Gen::type' is an alias for 'integer_sequence'. 103 | template 104 | struct Gen 105 | { 106 | using type = 107 | typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; 108 | }; 109 | 110 | template 111 | struct Gen 112 | { 113 | using type = integer_sequence; 114 | }; 115 | 116 | } // namespace utility_internal 117 | 118 | // Compile-time sequences of integers 119 | 120 | // make_integer_sequence 121 | // 122 | // This template alias is equivalent to 123 | // `integer_sequence`, and is designed to be a drop-in 124 | // replacement for C++14's `std::make_integer_sequence`. 125 | template 126 | using make_integer_sequence = typename utility_internal::Gen::type; 127 | 128 | // make_index_sequence 129 | // 130 | // This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, 131 | // and is designed to be a drop-in replacement for C++14's 132 | // `std::make_index_sequence`. 133 | template 134 | using make_index_sequence = make_integer_sequence; 135 | 136 | // index_sequence_for 137 | // 138 | // Converts a typename pack into an index sequence of the same length, and 139 | // is designed to be a drop-in replacement for C++14's 140 | // `std::index_sequence_for()` 141 | template 142 | using index_sequence_for = make_index_sequence; 143 | 144 | //// END OF CODE FROM GOOGLE ABSEIL 145 | 146 | #endif 147 | 148 | // dispatch utility (taken from ranges-v3) 149 | template struct priority_tag : priority_tag < N - 1 > {}; 150 | template<> struct priority_tag<0> {}; 151 | 152 | // taken from ranges-v3 153 | template 154 | struct static_const 155 | { 156 | static JSON_INLINE_VARIABLE constexpr T value{}; 157 | }; 158 | 159 | #ifndef JSON_HAS_CPP_17 160 | template 161 | constexpr T static_const::value; 162 | #endif 163 | 164 | template 165 | constexpr std::array make_array(Args&& ... args) 166 | { 167 | return std::array {{static_cast(std::forward(args))...}}; 168 | } 169 | 170 | } // namespace detail 171 | NLOHMANN_JSON_NAMESPACE_END 172 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/detected.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | // https://en.cppreference.com/w/cpp/experimental/is_detected 20 | struct nonesuch 21 | { 22 | nonesuch() = delete; 23 | ~nonesuch() = delete; 24 | nonesuch(nonesuch const&) = delete; 25 | nonesuch(nonesuch const&&) = delete; 26 | void operator=(nonesuch const&) = delete; 27 | void operator=(nonesuch&&) = delete; 28 | }; 29 | 30 | template class Op, 33 | class... Args> 34 | struct detector 35 | { 36 | using value_t = std::false_type; 37 | using type = Default; 38 | }; 39 | 40 | template class Op, class... Args> 41 | struct detector>, Op, Args...> 42 | { 43 | using value_t = std::true_type; 44 | using type = Op; 45 | }; 46 | 47 | template class Op, class... Args> 48 | using is_detected = typename detector::value_t; 49 | 50 | template class Op, class... Args> 51 | struct is_detected_lazy : is_detected { }; 52 | 53 | template class Op, class... Args> 54 | using detected_t = typename detector::type; 55 | 56 | template class Op, class... Args> 57 | using detected_or = detector; 58 | 59 | template class Op, class... Args> 60 | using detected_or_t = typename detected_or::type; 61 | 62 | template class Op, class... Args> 63 | using is_detected_exact = std::is_same>; 64 | 65 | template class Op, class... Args> 66 | using is_detected_convertible = 67 | std::is_convertible, To>; 68 | 69 | } // namespace detail 70 | NLOHMANN_JSON_NAMESPACE_END 71 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/identity_tag.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | // dispatching helper struct 18 | template struct identity_tag {}; 19 | 20 | } // namespace detail 21 | NLOHMANN_JSON_NAMESPACE_END 22 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/is_sax.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | #include // declval 13 | #include // string 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | NLOHMANN_JSON_NAMESPACE_BEGIN 20 | namespace detail 21 | { 22 | 23 | template 24 | using null_function_t = decltype(std::declval().null()); 25 | 26 | template 27 | using boolean_function_t = 28 | decltype(std::declval().boolean(std::declval())); 29 | 30 | template 31 | using number_integer_function_t = 32 | decltype(std::declval().number_integer(std::declval())); 33 | 34 | template 35 | using number_unsigned_function_t = 36 | decltype(std::declval().number_unsigned(std::declval())); 37 | 38 | template 39 | using number_float_function_t = decltype(std::declval().number_float( 40 | std::declval(), std::declval())); 41 | 42 | template 43 | using string_function_t = 44 | decltype(std::declval().string(std::declval())); 45 | 46 | template 47 | using binary_function_t = 48 | decltype(std::declval().binary(std::declval())); 49 | 50 | template 51 | using start_object_function_t = 52 | decltype(std::declval().start_object(std::declval())); 53 | 54 | template 55 | using key_function_t = 56 | decltype(std::declval().key(std::declval())); 57 | 58 | template 59 | using end_object_function_t = decltype(std::declval().end_object()); 60 | 61 | template 62 | using start_array_function_t = 63 | decltype(std::declval().start_array(std::declval())); 64 | 65 | template 66 | using end_array_function_t = decltype(std::declval().end_array()); 67 | 68 | template 69 | using parse_error_function_t = decltype(std::declval().parse_error( 70 | std::declval(), std::declval(), 71 | std::declval())); 72 | 73 | template 74 | struct is_sax 75 | { 76 | private: 77 | static_assert(is_basic_json::value, 78 | "BasicJsonType must be of type basic_json<...>"); 79 | 80 | using number_integer_t = typename BasicJsonType::number_integer_t; 81 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 82 | using number_float_t = typename BasicJsonType::number_float_t; 83 | using string_t = typename BasicJsonType::string_t; 84 | using binary_t = typename BasicJsonType::binary_t; 85 | using exception_t = typename BasicJsonType::exception; 86 | 87 | public: 88 | static constexpr bool value = 89 | is_detected_exact::value && 90 | is_detected_exact::value && 91 | is_detected_exact::value && 92 | is_detected_exact::value && 93 | is_detected_exact::value && 94 | is_detected_exact::value && 95 | is_detected_exact::value && 96 | is_detected_exact::value && 97 | is_detected_exact::value && 98 | is_detected_exact::value && 99 | is_detected_exact::value && 100 | is_detected_exact::value && 101 | is_detected_exact::value; 102 | }; 103 | 104 | template 105 | struct is_sax_static_asserts 106 | { 107 | private: 108 | static_assert(is_basic_json::value, 109 | "BasicJsonType must be of type basic_json<...>"); 110 | 111 | using number_integer_t = typename BasicJsonType::number_integer_t; 112 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 113 | using number_float_t = typename BasicJsonType::number_float_t; 114 | using string_t = typename BasicJsonType::string_t; 115 | using binary_t = typename BasicJsonType::binary_t; 116 | using exception_t = typename BasicJsonType::exception; 117 | 118 | public: 119 | static_assert(is_detected_exact::value, 120 | "Missing/invalid function: bool null()"); 121 | static_assert(is_detected_exact::value, 122 | "Missing/invalid function: bool boolean(bool)"); 123 | static_assert(is_detected_exact::value, 124 | "Missing/invalid function: bool boolean(bool)"); 125 | static_assert( 126 | is_detected_exact::value, 128 | "Missing/invalid function: bool number_integer(number_integer_t)"); 129 | static_assert( 130 | is_detected_exact::value, 132 | "Missing/invalid function: bool number_unsigned(number_unsigned_t)"); 133 | static_assert(is_detected_exact::value, 135 | "Missing/invalid function: bool number_float(number_float_t, const string_t&)"); 136 | static_assert( 137 | is_detected_exact::value, 138 | "Missing/invalid function: bool string(string_t&)"); 139 | static_assert( 140 | is_detected_exact::value, 141 | "Missing/invalid function: bool binary(binary_t&)"); 142 | static_assert(is_detected_exact::value, 143 | "Missing/invalid function: bool start_object(std::size_t)"); 144 | static_assert(is_detected_exact::value, 145 | "Missing/invalid function: bool key(string_t&)"); 146 | static_assert(is_detected_exact::value, 147 | "Missing/invalid function: bool end_object()"); 148 | static_assert(is_detected_exact::value, 149 | "Missing/invalid function: bool start_array(std::size_t)"); 150 | static_assert(is_detected_exact::value, 151 | "Missing/invalid function: bool end_array()"); 152 | static_assert( 153 | is_detected_exact::value, 154 | "Missing/invalid function: bool parse_error(std::size_t, const " 155 | "std::string&, const exception&)"); 156 | }; 157 | 158 | } // namespace detail 159 | NLOHMANN_JSON_NAMESPACE_END 160 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/std_fs.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #if JSON_HAS_EXPERIMENTAL_FILESYSTEM 14 | #include 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | namespace std_fs = std::experimental::filesystem; 19 | } // namespace detail 20 | NLOHMANN_JSON_NAMESPACE_END 21 | #elif JSON_HAS_FILESYSTEM 22 | #include // NOLINT(build/c++17) 23 | NLOHMANN_JSON_NAMESPACE_BEGIN 24 | namespace detail 25 | { 26 | namespace std_fs = std::filesystem; 27 | } // namespace detail 28 | NLOHMANN_JSON_NAMESPACE_END 29 | #endif 30 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | template struct make_void 18 | { 19 | using type = void; 20 | }; 21 | template using void_t = typename make_void::type; 22 | 23 | } // namespace detail 24 | NLOHMANN_JSON_NAMESPACE_END 25 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/output/output_adapters.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // copy 12 | #include // size_t 13 | #include // back_inserter 14 | #include // shared_ptr, make_shared 15 | #include // basic_string 16 | #include // vector 17 | 18 | #ifndef JSON_NO_IO 19 | #include // streamsize 20 | #include // basic_ostream 21 | #endif // JSON_NO_IO 22 | 23 | #include 24 | 25 | NLOHMANN_JSON_NAMESPACE_BEGIN 26 | namespace detail 27 | { 28 | 29 | /// abstract output adapter interface 30 | template struct output_adapter_protocol 31 | { 32 | virtual void write_character(CharType c) = 0; 33 | virtual void write_characters(const CharType* s, std::size_t length) = 0; 34 | virtual ~output_adapter_protocol() = default; 35 | 36 | output_adapter_protocol() = default; 37 | output_adapter_protocol(const output_adapter_protocol&) = default; 38 | output_adapter_protocol(output_adapter_protocol&&) noexcept = default; 39 | output_adapter_protocol& operator=(const output_adapter_protocol&) = default; 40 | output_adapter_protocol& operator=(output_adapter_protocol&&) noexcept = default; 41 | }; 42 | 43 | /// a type to simplify interfaces 44 | template 45 | using output_adapter_t = std::shared_ptr>; 46 | 47 | /// output adapter for byte vectors 48 | template> 49 | class output_vector_adapter : public output_adapter_protocol 50 | { 51 | public: 52 | explicit output_vector_adapter(std::vector& vec) noexcept 53 | : v(vec) 54 | {} 55 | 56 | void write_character(CharType c) override 57 | { 58 | v.push_back(c); 59 | } 60 | 61 | JSON_HEDLEY_NON_NULL(2) 62 | void write_characters(const CharType* s, std::size_t length) override 63 | { 64 | v.insert(v.end(), s, s + length); 65 | } 66 | 67 | private: 68 | std::vector& v; 69 | }; 70 | 71 | #ifndef JSON_NO_IO 72 | /// output adapter for output streams 73 | template 74 | class output_stream_adapter : public output_adapter_protocol 75 | { 76 | public: 77 | explicit output_stream_adapter(std::basic_ostream& s) noexcept 78 | : stream(s) 79 | {} 80 | 81 | void write_character(CharType c) override 82 | { 83 | stream.put(c); 84 | } 85 | 86 | JSON_HEDLEY_NON_NULL(2) 87 | void write_characters(const CharType* s, std::size_t length) override 88 | { 89 | stream.write(s, static_cast(length)); 90 | } 91 | 92 | private: 93 | std::basic_ostream& stream; 94 | }; 95 | #endif // JSON_NO_IO 96 | 97 | /// output adapter for basic_string 98 | template> 99 | class output_string_adapter : public output_adapter_protocol 100 | { 101 | public: 102 | explicit output_string_adapter(StringType& s) noexcept 103 | : str(s) 104 | {} 105 | 106 | void write_character(CharType c) override 107 | { 108 | str.push_back(c); 109 | } 110 | 111 | JSON_HEDLEY_NON_NULL(2) 112 | void write_characters(const CharType* s, std::size_t length) override 113 | { 114 | str.append(s, length); 115 | } 116 | 117 | private: 118 | StringType& str; 119 | }; 120 | 121 | template> 122 | class output_adapter 123 | { 124 | public: 125 | template> 126 | output_adapter(std::vector& vec) 127 | : oa(std::make_shared>(vec)) {} 128 | 129 | #ifndef JSON_NO_IO 130 | output_adapter(std::basic_ostream& s) 131 | : oa(std::make_shared>(s)) {} 132 | #endif // JSON_NO_IO 133 | 134 | output_adapter(StringType& s) 135 | : oa(std::make_shared>(s)) {} 136 | 137 | operator output_adapter_t() 138 | { 139 | return oa; 140 | } 141 | 142 | private: 143 | output_adapter_t oa = nullptr; 144 | }; 145 | 146 | } // namespace detail 147 | NLOHMANN_JSON_NAMESPACE_END 148 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/string_concat.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // strlen 12 | #include // string 13 | #include // forward 14 | 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | namespace detail 20 | { 21 | 22 | inline std::size_t concat_length() 23 | { 24 | return 0; 25 | } 26 | 27 | template 28 | inline std::size_t concat_length(const char* cstr, const Args& ... rest); 29 | 30 | template 31 | inline std::size_t concat_length(const StringType& str, const Args& ... rest); 32 | 33 | template 34 | inline std::size_t concat_length(const char /*c*/, const Args& ... rest) 35 | { 36 | return 1 + concat_length(rest...); 37 | } 38 | 39 | template 40 | inline std::size_t concat_length(const char* cstr, const Args& ... rest) 41 | { 42 | // cppcheck-suppress ignoredReturnValue 43 | return ::strlen(cstr) + concat_length(rest...); 44 | } 45 | 46 | template 47 | inline std::size_t concat_length(const StringType& str, const Args& ... rest) 48 | { 49 | return str.size() + concat_length(rest...); 50 | } 51 | 52 | template 53 | inline void concat_into(OutStringType& /*out*/) 54 | {} 55 | 56 | template 57 | using string_can_append = decltype(std::declval().append(std::declval < Arg && > ())); 58 | 59 | template 60 | using detect_string_can_append = is_detected; 61 | 62 | template 63 | using string_can_append_op = decltype(std::declval() += std::declval < Arg && > ()); 64 | 65 | template 66 | using detect_string_can_append_op = is_detected; 67 | 68 | template 69 | using string_can_append_iter = decltype(std::declval().append(std::declval().begin(), std::declval().end())); 70 | 71 | template 72 | using detect_string_can_append_iter = is_detected; 73 | 74 | template 75 | using string_can_append_data = decltype(std::declval().append(std::declval().data(), std::declval().size())); 76 | 77 | template 78 | using detect_string_can_append_data = is_detected; 79 | 80 | template < typename OutStringType, typename Arg, typename... Args, 81 | enable_if_t < !detect_string_can_append::value 82 | && detect_string_can_append_op::value, int > = 0 > 83 | inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest); 84 | 85 | template < typename OutStringType, typename Arg, typename... Args, 86 | enable_if_t < !detect_string_can_append::value 87 | && !detect_string_can_append_op::value 88 | && detect_string_can_append_iter::value, int > = 0 > 89 | inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest); 90 | 91 | template < typename OutStringType, typename Arg, typename... Args, 92 | enable_if_t < !detect_string_can_append::value 93 | && !detect_string_can_append_op::value 94 | && !detect_string_can_append_iter::value 95 | && detect_string_can_append_data::value, int > = 0 > 96 | inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest); 97 | 98 | template::value, int> = 0> 100 | inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest) 101 | { 102 | out.append(std::forward(arg)); 103 | concat_into(out, std::forward(rest)...); 104 | } 105 | 106 | template < typename OutStringType, typename Arg, typename... Args, 107 | enable_if_t < !detect_string_can_append::value 108 | && detect_string_can_append_op::value, int > > 109 | inline void concat_into(OutStringType& out, Arg&& arg, Args&& ... rest) 110 | { 111 | out += std::forward(arg); 112 | concat_into(out, std::forward(rest)...); 113 | } 114 | 115 | template < typename OutStringType, typename Arg, typename... Args, 116 | enable_if_t < !detect_string_can_append::value 117 | && !detect_string_can_append_op::value 118 | && detect_string_can_append_iter::value, int > > 119 | inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest) 120 | { 121 | out.append(arg.begin(), arg.end()); 122 | concat_into(out, std::forward(rest)...); 123 | } 124 | 125 | template < typename OutStringType, typename Arg, typename... Args, 126 | enable_if_t < !detect_string_can_append::value 127 | && !detect_string_can_append_op::value 128 | && !detect_string_can_append_iter::value 129 | && detect_string_can_append_data::value, int > > 130 | inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest) 131 | { 132 | out.append(arg.data(), arg.size()); 133 | concat_into(out, std::forward(rest)...); 134 | } 135 | 136 | template 137 | inline OutStringType concat(Args && ... args) 138 | { 139 | OutStringType str; 140 | str.reserve(concat_length(args...)); 141 | concat_into(str, std::forward(args)...); 142 | return str; 143 | } 144 | 145 | } // namespace detail 146 | NLOHMANN_JSON_NAMESPACE_END 147 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/string_escape.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | /*! 18 | @brief replace all occurrences of a substring by another string 19 | 20 | @param[in,out] s the string to manipulate; changed so that all 21 | occurrences of @a f are replaced with @a t 22 | @param[in] f the substring to replace with @a t 23 | @param[in] t the string to replace @a f 24 | 25 | @pre The search string @a f must not be empty. **This precondition is 26 | enforced with an assertion.** 27 | 28 | @since version 2.0.0 29 | */ 30 | template 31 | inline void replace_substring(StringType& s, const StringType& f, 32 | const StringType& t) 33 | { 34 | JSON_ASSERT(!f.empty()); 35 | for (auto pos = s.find(f); // find first occurrence of f 36 | pos != StringType::npos; // make sure f was found 37 | s.replace(pos, f.size(), t), // replace with t, and 38 | pos = s.find(f, pos + t.size())) // find next occurrence of f 39 | {} 40 | } 41 | 42 | /*! 43 | * @brief string escaping as described in RFC 6901 (Sect. 4) 44 | * @param[in] s string to escape 45 | * @return escaped string 46 | * 47 | * Note the order of escaping "~" to "~0" and "/" to "~1" is important. 48 | */ 49 | template 50 | inline StringType escape(StringType s) 51 | { 52 | replace_substring(s, StringType{"~"}, StringType{"~0"}); 53 | replace_substring(s, StringType{"/"}, StringType{"~1"}); 54 | return s; 55 | } 56 | 57 | /*! 58 | * @brief string unescaping as described in RFC 6901 (Sect. 4) 59 | * @param[in] s string to unescape 60 | * @return unescaped string 61 | * 62 | * Note the order of escaping "~1" to "/" and "~0" to "~" is important. 63 | */ 64 | template 65 | static void unescape(StringType& s) 66 | { 67 | replace_substring(s, StringType{"~1"}, StringType{"/"}); 68 | replace_substring(s, StringType{"~0"}, StringType{"~"}); 69 | } 70 | 71 | } // namespace detail 72 | NLOHMANN_JSON_NAMESPACE_END 73 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/string_utils.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | #include // string, to_string 13 | 14 | #include 15 | 16 | NLOHMANN_JSON_NAMESPACE_BEGIN 17 | namespace detail 18 | { 19 | 20 | template 21 | void int_to_string(StringType& target, std::size_t value) 22 | { 23 | // For ADL 24 | using std::to_string; 25 | target = to_string(value); 26 | } 27 | 28 | template 29 | StringType to_string(std::size_t value) 30 | { 31 | StringType result; 32 | int_to_string(result, value); 33 | return result; 34 | } 35 | 36 | } // namespace detail 37 | NLOHMANN_JSON_NAMESPACE_END 38 | -------------------------------------------------------------------------------- /backend/nlohmann/detail/value_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // array 12 | #include // size_t 13 | #include // uint8_t 14 | #include // string 15 | 16 | #include 17 | #if JSON_HAS_THREE_WAY_COMPARISON 18 | #include // partial_ordering 19 | #endif 20 | 21 | NLOHMANN_JSON_NAMESPACE_BEGIN 22 | namespace detail 23 | { 24 | 25 | /////////////////////////// 26 | // JSON type enumeration // 27 | /////////////////////////// 28 | 29 | /*! 30 | @brief the JSON type enumeration 31 | 32 | This enumeration collects the different JSON types. It is internally used to 33 | distinguish the stored values, and the functions @ref basic_json::is_null(), 34 | @ref basic_json::is_object(), @ref basic_json::is_array(), 35 | @ref basic_json::is_string(), @ref basic_json::is_boolean(), 36 | @ref basic_json::is_number() (with @ref basic_json::is_number_integer(), 37 | @ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), 38 | @ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and 39 | @ref basic_json::is_structured() rely on it. 40 | 41 | @note There are three enumeration entries (number_integer, number_unsigned, and 42 | number_float), because the library distinguishes these three types for numbers: 43 | @ref basic_json::number_unsigned_t is used for unsigned integers, 44 | @ref basic_json::number_integer_t is used for signed integers, and 45 | @ref basic_json::number_float_t is used for floating-point numbers or to 46 | approximate integers which do not fit in the limits of their respective type. 47 | 48 | @sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON 49 | value with the default value for a given type 50 | 51 | @since version 1.0.0 52 | */ 53 | enum class value_t : std::uint8_t 54 | { 55 | null, ///< null value 56 | object, ///< object (unordered set of name/value pairs) 57 | array, ///< array (ordered collection of values) 58 | string, ///< string value 59 | boolean, ///< boolean value 60 | number_integer, ///< number value (signed integer) 61 | number_unsigned, ///< number value (unsigned integer) 62 | number_float, ///< number value (floating-point) 63 | binary, ///< binary array (ordered collection of bytes) 64 | discarded ///< discarded by the parser callback function 65 | }; 66 | 67 | /*! 68 | @brief comparison operator for JSON types 69 | 70 | Returns an ordering that is similar to Python: 71 | - order: null < boolean < number < object < array < string < binary 72 | - furthermore, each type is not smaller than itself 73 | - discarded values are not comparable 74 | - binary is represented as a b"" string in python and directly comparable to a 75 | string; however, making a binary array directly comparable with a string would 76 | be surprising behavior in a JSON file. 77 | 78 | @since version 1.0.0 79 | */ 80 | #if JSON_HAS_THREE_WAY_COMPARISON 81 | inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* 82 | #else 83 | inline bool operator<(const value_t lhs, const value_t rhs) noexcept 84 | #endif 85 | { 86 | static constexpr std::array order = {{ 87 | 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, 88 | 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, 89 | 6 /* binary */ 90 | } 91 | }; 92 | 93 | const auto l_index = static_cast(lhs); 94 | const auto r_index = static_cast(rhs); 95 | #if JSON_HAS_THREE_WAY_COMPARISON 96 | if (l_index < order.size() && r_index < order.size()) 97 | { 98 | return order[l_index] <=> order[r_index]; // *NOPAD* 99 | } 100 | return std::partial_ordering::unordered; 101 | #else 102 | return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; 103 | #endif 104 | } 105 | 106 | // GCC selects the built-in operator< over an operator rewritten from 107 | // a user-defined spaceship operator 108 | // Clang, MSVC, and ICC select the rewritten candidate 109 | // (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) 110 | #if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) 111 | inline bool operator<(const value_t lhs, const value_t rhs) noexcept 112 | { 113 | return std::is_lt(lhs <=> rhs); // *NOPAD* 114 | } 115 | #endif 116 | 117 | } // namespace detail 118 | NLOHMANN_JSON_NAMESPACE_END 119 | -------------------------------------------------------------------------------- /backend/nlohmann/json_fwd.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ 10 | #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ 11 | 12 | #include // int64_t, uint64_t 13 | #include // map 14 | #include // allocator 15 | #include // string 16 | #include // vector 17 | 18 | #include 19 | 20 | /*! 21 | @brief namespace for Niels Lohmann 22 | @see https://github.com/nlohmann 23 | @since version 1.0.0 24 | */ 25 | NLOHMANN_JSON_NAMESPACE_BEGIN 26 | 27 | /*! 28 | @brief default JSONSerializer template argument 29 | 30 | This serializer ignores the template arguments and uses ADL 31 | ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) 32 | for serialization. 33 | */ 34 | template 35 | struct adl_serializer; 36 | 37 | /// a class to store JSON values 38 | /// @sa https://json.nlohmann.me/api/basic_json/ 39 | template class ObjectType = 40 | std::map, 41 | template class ArrayType = std::vector, 42 | class StringType = std::string, class BooleanType = bool, 43 | class NumberIntegerType = std::int64_t, 44 | class NumberUnsignedType = std::uint64_t, 45 | class NumberFloatType = double, 46 | template class AllocatorType = std::allocator, 47 | template class JSONSerializer = 48 | adl_serializer, 49 | class BinaryType = std::vector, // cppcheck-suppress syntaxError 50 | class CustomBaseClass = void> 51 | class basic_json; 52 | 53 | /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document 54 | /// @sa https://json.nlohmann.me/api/json_pointer/ 55 | template 56 | class json_pointer; 57 | 58 | /*! 59 | @brief default specialization 60 | @sa https://json.nlohmann.me/api/json/ 61 | */ 62 | using json = basic_json<>; 63 | 64 | /// @brief a minimal map-like container that preserves insertion order 65 | /// @sa https://json.nlohmann.me/api/ordered_map/ 66 | template 67 | struct ordered_map; 68 | 69 | /// @brief specialization that maintains the insertion order of object keys 70 | /// @sa https://json.nlohmann.me/api/ordered_json/ 71 | using ordered_json = basic_json; 72 | 73 | NLOHMANN_JSON_NAMESPACE_END 74 | 75 | #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ 76 | -------------------------------------------------------------------------------- /backend/nlohmann/thirdparty/hedley/hedley_undef.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #undef JSON_HEDLEY_ALWAYS_INLINE 12 | #undef JSON_HEDLEY_ARM_VERSION 13 | #undef JSON_HEDLEY_ARM_VERSION_CHECK 14 | #undef JSON_HEDLEY_ARRAY_PARAM 15 | #undef JSON_HEDLEY_ASSUME 16 | #undef JSON_HEDLEY_BEGIN_C_DECLS 17 | #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE 18 | #undef JSON_HEDLEY_CLANG_HAS_BUILTIN 19 | #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE 20 | #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE 21 | #undef JSON_HEDLEY_CLANG_HAS_EXTENSION 22 | #undef JSON_HEDLEY_CLANG_HAS_FEATURE 23 | #undef JSON_HEDLEY_CLANG_HAS_WARNING 24 | #undef JSON_HEDLEY_COMPCERT_VERSION 25 | #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK 26 | #undef JSON_HEDLEY_CONCAT 27 | #undef JSON_HEDLEY_CONCAT3 28 | #undef JSON_HEDLEY_CONCAT3_EX 29 | #undef JSON_HEDLEY_CONCAT_EX 30 | #undef JSON_HEDLEY_CONST 31 | #undef JSON_HEDLEY_CONSTEXPR 32 | #undef JSON_HEDLEY_CONST_CAST 33 | #undef JSON_HEDLEY_CPP_CAST 34 | #undef JSON_HEDLEY_CRAY_VERSION 35 | #undef JSON_HEDLEY_CRAY_VERSION_CHECK 36 | #undef JSON_HEDLEY_C_DECL 37 | #undef JSON_HEDLEY_DEPRECATED 38 | #undef JSON_HEDLEY_DEPRECATED_FOR 39 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL 40 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ 41 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED 42 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES 43 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS 44 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION 45 | #undef JSON_HEDLEY_DIAGNOSTIC_POP 46 | #undef JSON_HEDLEY_DIAGNOSTIC_PUSH 47 | #undef JSON_HEDLEY_DMC_VERSION 48 | #undef JSON_HEDLEY_DMC_VERSION_CHECK 49 | #undef JSON_HEDLEY_EMPTY_BASES 50 | #undef JSON_HEDLEY_EMSCRIPTEN_VERSION 51 | #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK 52 | #undef JSON_HEDLEY_END_C_DECLS 53 | #undef JSON_HEDLEY_FLAGS 54 | #undef JSON_HEDLEY_FLAGS_CAST 55 | #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE 56 | #undef JSON_HEDLEY_GCC_HAS_BUILTIN 57 | #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE 58 | #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE 59 | #undef JSON_HEDLEY_GCC_HAS_EXTENSION 60 | #undef JSON_HEDLEY_GCC_HAS_FEATURE 61 | #undef JSON_HEDLEY_GCC_HAS_WARNING 62 | #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK 63 | #undef JSON_HEDLEY_GCC_VERSION 64 | #undef JSON_HEDLEY_GCC_VERSION_CHECK 65 | #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE 66 | #undef JSON_HEDLEY_GNUC_HAS_BUILTIN 67 | #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE 68 | #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE 69 | #undef JSON_HEDLEY_GNUC_HAS_EXTENSION 70 | #undef JSON_HEDLEY_GNUC_HAS_FEATURE 71 | #undef JSON_HEDLEY_GNUC_HAS_WARNING 72 | #undef JSON_HEDLEY_GNUC_VERSION 73 | #undef JSON_HEDLEY_GNUC_VERSION_CHECK 74 | #undef JSON_HEDLEY_HAS_ATTRIBUTE 75 | #undef JSON_HEDLEY_HAS_BUILTIN 76 | #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE 77 | #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS 78 | #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE 79 | #undef JSON_HEDLEY_HAS_EXTENSION 80 | #undef JSON_HEDLEY_HAS_FEATURE 81 | #undef JSON_HEDLEY_HAS_WARNING 82 | #undef JSON_HEDLEY_IAR_VERSION 83 | #undef JSON_HEDLEY_IAR_VERSION_CHECK 84 | #undef JSON_HEDLEY_IBM_VERSION 85 | #undef JSON_HEDLEY_IBM_VERSION_CHECK 86 | #undef JSON_HEDLEY_IMPORT 87 | #undef JSON_HEDLEY_INLINE 88 | #undef JSON_HEDLEY_INTEL_CL_VERSION 89 | #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK 90 | #undef JSON_HEDLEY_INTEL_VERSION 91 | #undef JSON_HEDLEY_INTEL_VERSION_CHECK 92 | #undef JSON_HEDLEY_IS_CONSTANT 93 | #undef JSON_HEDLEY_IS_CONSTEXPR_ 94 | #undef JSON_HEDLEY_LIKELY 95 | #undef JSON_HEDLEY_MALLOC 96 | #undef JSON_HEDLEY_MCST_LCC_VERSION 97 | #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK 98 | #undef JSON_HEDLEY_MESSAGE 99 | #undef JSON_HEDLEY_MSVC_VERSION 100 | #undef JSON_HEDLEY_MSVC_VERSION_CHECK 101 | #undef JSON_HEDLEY_NEVER_INLINE 102 | #undef JSON_HEDLEY_NON_NULL 103 | #undef JSON_HEDLEY_NO_ESCAPE 104 | #undef JSON_HEDLEY_NO_RETURN 105 | #undef JSON_HEDLEY_NO_THROW 106 | #undef JSON_HEDLEY_NULL 107 | #undef JSON_HEDLEY_PELLES_VERSION 108 | #undef JSON_HEDLEY_PELLES_VERSION_CHECK 109 | #undef JSON_HEDLEY_PGI_VERSION 110 | #undef JSON_HEDLEY_PGI_VERSION_CHECK 111 | #undef JSON_HEDLEY_PREDICT 112 | #undef JSON_HEDLEY_PRINTF_FORMAT 113 | #undef JSON_HEDLEY_PRIVATE 114 | #undef JSON_HEDLEY_PUBLIC 115 | #undef JSON_HEDLEY_PURE 116 | #undef JSON_HEDLEY_REINTERPRET_CAST 117 | #undef JSON_HEDLEY_REQUIRE 118 | #undef JSON_HEDLEY_REQUIRE_CONSTEXPR 119 | #undef JSON_HEDLEY_REQUIRE_MSG 120 | #undef JSON_HEDLEY_RESTRICT 121 | #undef JSON_HEDLEY_RETURNS_NON_NULL 122 | #undef JSON_HEDLEY_SENTINEL 123 | #undef JSON_HEDLEY_STATIC_ASSERT 124 | #undef JSON_HEDLEY_STATIC_CAST 125 | #undef JSON_HEDLEY_STRINGIFY 126 | #undef JSON_HEDLEY_STRINGIFY_EX 127 | #undef JSON_HEDLEY_SUNPRO_VERSION 128 | #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK 129 | #undef JSON_HEDLEY_TINYC_VERSION 130 | #undef JSON_HEDLEY_TINYC_VERSION_CHECK 131 | #undef JSON_HEDLEY_TI_ARMCL_VERSION 132 | #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK 133 | #undef JSON_HEDLEY_TI_CL2000_VERSION 134 | #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK 135 | #undef JSON_HEDLEY_TI_CL430_VERSION 136 | #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK 137 | #undef JSON_HEDLEY_TI_CL6X_VERSION 138 | #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK 139 | #undef JSON_HEDLEY_TI_CL7X_VERSION 140 | #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK 141 | #undef JSON_HEDLEY_TI_CLPRU_VERSION 142 | #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK 143 | #undef JSON_HEDLEY_TI_VERSION 144 | #undef JSON_HEDLEY_TI_VERSION_CHECK 145 | #undef JSON_HEDLEY_UNAVAILABLE 146 | #undef JSON_HEDLEY_UNLIKELY 147 | #undef JSON_HEDLEY_UNPREDICTABLE 148 | #undef JSON_HEDLEY_UNREACHABLE 149 | #undef JSON_HEDLEY_UNREACHABLE_RETURN 150 | #undef JSON_HEDLEY_VERSION 151 | #undef JSON_HEDLEY_VERSION_DECODE_MAJOR 152 | #undef JSON_HEDLEY_VERSION_DECODE_MINOR 153 | #undef JSON_HEDLEY_VERSION_DECODE_REVISION 154 | #undef JSON_HEDLEY_VERSION_ENCODE 155 | #undef JSON_HEDLEY_WARNING 156 | #undef JSON_HEDLEY_WARN_UNUSED_RESULT 157 | #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG 158 | #undef JSON_HEDLEY_FALL_THROUGH 159 | -------------------------------------------------------------------------------- /backend/process.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/process.hpp -------------------------------------------------------------------------------- /backend/texts.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/backend/texts.hpp -------------------------------------------------------------------------------- /backend/update.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | * update.hpp 4 | * 检查更新 5 | */ 6 | 7 | void CheckUpdate() { 8 | cout << "检查更新中..." << endl; 9 | wfstream file("version.txt", ios::in); 10 | 11 | // 检查并删除旧的 headline.txt 文件 12 | if (file.is_open()) { 13 | file.close(); 14 | if (remove("version.txt") != 0) { 15 | MessageBox(NULL, _T("文件删除失败,请尝试手动删除此目录下的 version.txt"), _T("错误"), MB_ICONERROR | MB_OK); 16 | } 17 | } 18 | 19 | // 被逼无奈火绒会报毒,所以只能用curl了(┬┬﹏┬┬) 20 | ExecuteCmd( 21 | L"curl", 22 | LR"(-o "version.txt" "https://raw.githubusercontent.com/King-zzk/king-zzk.github.io/refs/heads/main/version.txt)" 23 | ); 24 | if (_access("./version.txt", 0) == -1) { 25 | MessageBox(NULL, TEXT("直连github失败,正在使用镜像站!"), TEXT("错误"), MB_OK); 26 | ExecuteCmd( 27 | L"curl", 28 | LR"(-o "version.txt" "https://gh.llkk.cc/https://raw.githubusercontent.com/King-zzk/king-zzk.github.io/refs/heads/main/version.txt)" 29 | ); 30 | } 31 | file.open("version.txt", ios::in); 32 | if (file.is_open()) { 33 | wstring line; 34 | if (getline(file, line)) { // 只读取第一行 35 | if (line == text::version) { 36 | MessageBox(NULL, _T("当前版本为最新版本"), _T("信息"), MB_ICONINFORMATION | MB_OK); 37 | } else if (line > text::version) { 38 | wstring temp = L"检测到新版本 " + line + L"\r\n是否要跳转到Github仓库页面下载新版本?"; 39 | if (MessageBox(NULL, temp.c_str(), _T("检测到新版本"), MB_ICONINFORMATION | MB_YESNO) == IDYES) { 40 | ShellExecute(NULL, L"open", (text::website + L"/releases").c_str(), NULL, NULL, SW_SHOWNORMAL); 41 | } 42 | } else { 43 | MessageBox(NULL, _T("哇哦!当前版本居然比“最新版本”还要新!"), _T("信息"), MB_ICONINFORMATION | MB_OK); 44 | } 45 | file.close(); 46 | } else { 47 | file.close(); 48 | MessageBox(NULL, _T("更新检查失败,version.txt 中的内容无效"), _T("错误"), MB_ICONERROR | MB_OK); 49 | } 50 | } else { 51 | MessageBox(NULL, _T("更新检查失败,无法打开 version.txt(开启代理试试!)"), _T("错误"), MB_ICONERROR | MB_OK); 52 | } 53 | 54 | if (_access("version.txt", 0) == 0) { 55 | if (remove("version.txt") != 0) { 56 | MessageBox(NULL, _T("文件删除失败,请尝试手动删除此目录下的 version.txt"), _T("警告"), MB_ICONWARNING | MB_OK); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VC_EXTRALEAN 4 | #define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料 5 | #endif 6 | 7 | #include "targetver.h" 8 | 9 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的 10 | 11 | // 关闭 MFC 的一些常见且经常可放心忽略的隐藏警告消息 12 | #define _AFX_ALL_WARNINGS 13 | 14 | #include // MFC 核心组件和标准组件 15 | #include // MFC 扩展 16 | 17 | 18 | #include // MFC 自动化类 19 | 20 | 21 | 22 | #ifndef _AFX_NO_OLE_SUPPORT 23 | #include // MFC 对 Internet Explorer 4 公共控件的支持 24 | #endif 25 | #ifndef _AFX_NO_AFXCMN_SUPPORT 26 | #include // MFC 对 Windows 公共控件的支持 27 | #endif // _AFX_NO_AFXCMN_SUPPORT 28 | 29 | #include // MFC 支持功能区和控制条 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | #ifdef _UNICODE 40 | #if defined _M_IX86 41 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 42 | #elif defined _M_X64 43 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 44 | #else 45 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 46 | #endif 47 | #endif 48 | 49 | 50 | -------------------------------------------------------------------------------- /include/nlohmann/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2025 Niels Lohmann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /include/nlohmann/adl_serializer.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | 20 | /// @sa https://json.nlohmann.me/api/adl_serializer/ 21 | template 22 | struct adl_serializer 23 | { 24 | /// @brief convert a JSON value to any value type 25 | /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 26 | template 27 | static auto from_json(BasicJsonType && j, TargetType& val) noexcept( 28 | noexcept(::nlohmann::from_json(std::forward(j), val))) 29 | -> decltype(::nlohmann::from_json(std::forward(j), val), void()) 30 | { 31 | ::nlohmann::from_json(std::forward(j), val); 32 | } 33 | 34 | /// @brief convert a JSON value to any value type 35 | /// @sa https://json.nlohmann.me/api/adl_serializer/from_json/ 36 | template 37 | static auto from_json(BasicJsonType && j) noexcept( 38 | noexcept(::nlohmann::from_json(std::forward(j), detail::identity_tag {}))) 39 | -> decltype(::nlohmann::from_json(std::forward(j), detail::identity_tag {})) 40 | { 41 | return ::nlohmann::from_json(std::forward(j), detail::identity_tag {}); 42 | } 43 | 44 | /// @brief convert any value type to a JSON value 45 | /// @sa https://json.nlohmann.me/api/adl_serializer/to_json/ 46 | template 47 | static auto to_json(BasicJsonType& j, TargetType && val) noexcept( 48 | noexcept(::nlohmann::to_json(j, std::forward(val)))) 49 | -> decltype(::nlohmann::to_json(j, std::forward(val)), void()) 50 | { 51 | ::nlohmann::to_json(j, std::forward(val)); 52 | } 53 | }; 54 | 55 | NLOHMANN_JSON_NAMESPACE_END 56 | -------------------------------------------------------------------------------- /include/nlohmann/byte_container_with_subtype.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // uint8_t, uint64_t 12 | #include // tie 13 | #include // move 14 | 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | 19 | /// @brief an internal type for a backed binary type 20 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/ 21 | template 22 | class byte_container_with_subtype : public BinaryType 23 | { 24 | public: 25 | using container_type = BinaryType; 26 | using subtype_type = std::uint64_t; 27 | 28 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 29 | byte_container_with_subtype() noexcept(noexcept(container_type())) 30 | : container_type() 31 | {} 32 | 33 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 34 | byte_container_with_subtype(const container_type& b) noexcept(noexcept(container_type(b))) 35 | : container_type(b) 36 | {} 37 | 38 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 39 | byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b)))) 40 | : container_type(std::move(b)) 41 | {} 42 | 43 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 44 | byte_container_with_subtype(const container_type& b, subtype_type subtype_) noexcept(noexcept(container_type(b))) 45 | : container_type(b) 46 | , m_subtype(subtype_) 47 | , m_has_subtype(true) 48 | {} 49 | 50 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/byte_container_with_subtype/ 51 | byte_container_with_subtype(container_type&& b, subtype_type subtype_) noexcept(noexcept(container_type(std::move(b)))) 52 | : container_type(std::move(b)) 53 | , m_subtype(subtype_) 54 | , m_has_subtype(true) 55 | {} 56 | 57 | bool operator==(const byte_container_with_subtype& rhs) const 58 | { 59 | return std::tie(static_cast(*this), m_subtype, m_has_subtype) == 60 | std::tie(static_cast(rhs), rhs.m_subtype, rhs.m_has_subtype); 61 | } 62 | 63 | bool operator!=(const byte_container_with_subtype& rhs) const 64 | { 65 | return !(rhs == *this); 66 | } 67 | 68 | /// @brief sets the binary subtype 69 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/set_subtype/ 70 | void set_subtype(subtype_type subtype_) noexcept 71 | { 72 | m_subtype = subtype_; 73 | m_has_subtype = true; 74 | } 75 | 76 | /// @brief return the binary subtype 77 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/subtype/ 78 | constexpr subtype_type subtype() const noexcept 79 | { 80 | return m_has_subtype ? m_subtype : static_cast(-1); 81 | } 82 | 83 | /// @brief return whether the value has a subtype 84 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/has_subtype/ 85 | constexpr bool has_subtype() const noexcept 86 | { 87 | return m_has_subtype; 88 | } 89 | 90 | /// @brief clears the binary subtype 91 | /// @sa https://json.nlohmann.me/api/byte_container_with_subtype/clear_subtype/ 92 | void clear_subtype() noexcept 93 | { 94 | m_subtype = 0; 95 | m_has_subtype = false; 96 | } 97 | 98 | private: 99 | subtype_type m_subtype = 0; 100 | bool m_has_subtype = false; 101 | }; 102 | 103 | NLOHMANN_JSON_NAMESPACE_END 104 | -------------------------------------------------------------------------------- /include/nlohmann/detail/abi_macros.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | // This file contains all macro definitions affecting or depending on the ABI 12 | 13 | #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK 14 | #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) 15 | #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 16 | #warning "Already included a different version of the library!" 17 | #endif 18 | #endif 19 | #endif 20 | 21 | #define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) 22 | #define NLOHMANN_JSON_VERSION_MINOR 12 // NOLINT(modernize-macro-to-enum) 23 | #define NLOHMANN_JSON_VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) 24 | 25 | #ifndef JSON_DIAGNOSTICS 26 | #define JSON_DIAGNOSTICS 0 27 | #endif 28 | 29 | #ifndef JSON_DIAGNOSTIC_POSITIONS 30 | #define JSON_DIAGNOSTIC_POSITIONS 0 31 | #endif 32 | 33 | #ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 34 | #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 35 | #endif 36 | 37 | #if JSON_DIAGNOSTICS 38 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag 39 | #else 40 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS 41 | #endif 42 | 43 | #if JSON_DIAGNOSTIC_POSITIONS 44 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS _dp 45 | #else 46 | #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS 47 | #endif 48 | 49 | #if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 50 | #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp 51 | #else 52 | #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON 53 | #endif 54 | 55 | #ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION 56 | #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 57 | #endif 58 | 59 | // Construct the namespace ABI tags component 60 | #define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c 61 | #define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ 62 | NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) 63 | 64 | #define NLOHMANN_JSON_ABI_TAGS \ 65 | NLOHMANN_JSON_ABI_TAGS_CONCAT( \ 66 | NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ 67 | NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ 68 | NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) 69 | 70 | // Construct the namespace version component 71 | #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ 72 | _v ## major ## _ ## minor ## _ ## patch 73 | #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ 74 | NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) 75 | 76 | #if NLOHMANN_JSON_NAMESPACE_NO_VERSION 77 | #define NLOHMANN_JSON_NAMESPACE_VERSION 78 | #else 79 | #define NLOHMANN_JSON_NAMESPACE_VERSION \ 80 | NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ 81 | NLOHMANN_JSON_VERSION_MINOR, \ 82 | NLOHMANN_JSON_VERSION_PATCH) 83 | #endif 84 | 85 | // Combine namespace components 86 | #define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b 87 | #define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ 88 | NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) 89 | 90 | #ifndef NLOHMANN_JSON_NAMESPACE 91 | #define NLOHMANN_JSON_NAMESPACE \ 92 | nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ 93 | NLOHMANN_JSON_ABI_TAGS, \ 94 | NLOHMANN_JSON_NAMESPACE_VERSION) 95 | #endif 96 | 97 | #ifndef NLOHMANN_JSON_NAMESPACE_BEGIN 98 | #define NLOHMANN_JSON_NAMESPACE_BEGIN \ 99 | namespace nlohmann \ 100 | { \ 101 | inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ 102 | NLOHMANN_JSON_ABI_TAGS, \ 103 | NLOHMANN_JSON_NAMESPACE_VERSION) \ 104 | { 105 | #endif 106 | 107 | #ifndef NLOHMANN_JSON_NAMESPACE_END 108 | #define NLOHMANN_JSON_NAMESPACE_END \ 109 | } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ 110 | } // namespace nlohmann 111 | #endif 112 | -------------------------------------------------------------------------------- /include/nlohmann/detail/hash.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // uint8_t 12 | #include // size_t 13 | #include // hash 14 | 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | namespace detail 20 | { 21 | 22 | // boost::hash_combine 23 | inline std::size_t combine(std::size_t seed, std::size_t h) noexcept 24 | { 25 | seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U); 26 | return seed; 27 | } 28 | 29 | /*! 30 | @brief hash a JSON value 31 | 32 | The hash function tries to rely on std::hash where possible. Furthermore, the 33 | type of the JSON value is taken into account to have different hash values for 34 | null, 0, 0U, and false, etc. 35 | 36 | @tparam BasicJsonType basic_json specialization 37 | @param j JSON value to hash 38 | @return hash value of j 39 | */ 40 | template 41 | std::size_t hash(const BasicJsonType& j) 42 | { 43 | using string_t = typename BasicJsonType::string_t; 44 | using number_integer_t = typename BasicJsonType::number_integer_t; 45 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 46 | using number_float_t = typename BasicJsonType::number_float_t; 47 | 48 | const auto type = static_cast(j.type()); 49 | switch (j.type()) 50 | { 51 | case BasicJsonType::value_t::null: 52 | case BasicJsonType::value_t::discarded: 53 | { 54 | return combine(type, 0); 55 | } 56 | 57 | case BasicJsonType::value_t::object: 58 | { 59 | auto seed = combine(type, j.size()); 60 | for (const auto& element : j.items()) 61 | { 62 | const auto h = std::hash {}(element.key()); 63 | seed = combine(seed, h); 64 | seed = combine(seed, hash(element.value())); 65 | } 66 | return seed; 67 | } 68 | 69 | case BasicJsonType::value_t::array: 70 | { 71 | auto seed = combine(type, j.size()); 72 | for (const auto& element : j) 73 | { 74 | seed = combine(seed, hash(element)); 75 | } 76 | return seed; 77 | } 78 | 79 | case BasicJsonType::value_t::string: 80 | { 81 | const auto h = std::hash {}(j.template get_ref()); 82 | return combine(type, h); 83 | } 84 | 85 | case BasicJsonType::value_t::boolean: 86 | { 87 | const auto h = std::hash {}(j.template get()); 88 | return combine(type, h); 89 | } 90 | 91 | case BasicJsonType::value_t::number_integer: 92 | { 93 | const auto h = std::hash {}(j.template get()); 94 | return combine(type, h); 95 | } 96 | 97 | case BasicJsonType::value_t::number_unsigned: 98 | { 99 | const auto h = std::hash {}(j.template get()); 100 | return combine(type, h); 101 | } 102 | 103 | case BasicJsonType::value_t::number_float: 104 | { 105 | const auto h = std::hash {}(j.template get()); 106 | return combine(type, h); 107 | } 108 | 109 | case BasicJsonType::value_t::binary: 110 | { 111 | auto seed = combine(type, j.get_binary().size()); 112 | const auto h = std::hash {}(j.get_binary().has_subtype()); 113 | seed = combine(seed, h); 114 | seed = combine(seed, static_cast(j.get_binary().subtype())); 115 | for (const auto byte : j.get_binary()) 116 | { 117 | seed = combine(seed, std::hash {}(byte)); 118 | } 119 | return seed; 120 | } 121 | 122 | default: // LCOV_EXCL_LINE 123 | JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE 124 | return 0; // LCOV_EXCL_LINE 125 | } 126 | } 127 | 128 | } // namespace detail 129 | NLOHMANN_JSON_NAMESPACE_END 130 | -------------------------------------------------------------------------------- /include/nlohmann/detail/input/position_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | /// struct to capture the start position of the current token 20 | struct position_t 21 | { 22 | /// the total number of characters read 23 | std::size_t chars_read_total = 0; 24 | /// the number of characters read in the current line 25 | std::size_t chars_read_current_line = 0; 26 | /// the number of lines read 27 | std::size_t lines_read = 0; 28 | 29 | /// conversion to size_t to preserve SAX interface 30 | constexpr operator size_t() const 31 | { 32 | return chars_read_total; 33 | } 34 | }; 35 | 36 | } // namespace detail 37 | NLOHMANN_JSON_NAMESPACE_END 38 | -------------------------------------------------------------------------------- /include/nlohmann/detail/iterators/internal_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | NLOHMANN_JSON_NAMESPACE_BEGIN 15 | namespace detail 16 | { 17 | 18 | /*! 19 | @brief an iterator value 20 | 21 | @note This structure could easily be a union, but MSVC currently does not allow 22 | unions members with complex constructors, see https://github.com/nlohmann/json/pull/105. 23 | */ 24 | template struct internal_iterator 25 | { 26 | /// iterator for JSON objects 27 | typename BasicJsonType::object_t::iterator object_iterator {}; 28 | /// iterator for JSON arrays 29 | typename BasicJsonType::array_t::iterator array_iterator {}; 30 | /// generic iterator for all other types 31 | primitive_iterator_t primitive_iterator {}; 32 | }; 33 | 34 | } // namespace detail 35 | NLOHMANN_JSON_NAMESPACE_END 36 | -------------------------------------------------------------------------------- /include/nlohmann/detail/iterators/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // random_access_iterator_tag 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | template 22 | struct iterator_types {}; 23 | 24 | template 25 | struct iterator_types < 26 | It, 27 | void_t> 29 | { 30 | using difference_type = typename It::difference_type; 31 | using value_type = typename It::value_type; 32 | using pointer = typename It::pointer; 33 | using reference = typename It::reference; 34 | using iterator_category = typename It::iterator_category; 35 | }; 36 | 37 | // This is required as some compilers implement std::iterator_traits in a way that 38 | // doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. 39 | template 40 | struct iterator_traits 41 | { 42 | }; 43 | 44 | template 45 | struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> 46 | : iterator_types 47 | { 48 | }; 49 | 50 | template 51 | struct iterator_traits::value>> 52 | { 53 | using iterator_category = std::random_access_iterator_tag; 54 | using value_type = T; 55 | using difference_type = ptrdiff_t; 56 | using pointer = T*; 57 | using reference = T&; 58 | }; 59 | 60 | } // namespace detail 61 | NLOHMANN_JSON_NAMESPACE_END 62 | -------------------------------------------------------------------------------- /include/nlohmann/detail/iterators/json_reverse_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // ptrdiff_t 12 | #include // reverse_iterator 13 | #include // declval 14 | 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | ////////////////////// 22 | // reverse_iterator // 23 | ////////////////////// 24 | 25 | /*! 26 | @brief a template for a reverse iterator class 27 | 28 | @tparam Base the base iterator type to reverse. Valid types are @ref 29 | iterator (to create @ref reverse_iterator) and @ref const_iterator (to 30 | create @ref const_reverse_iterator). 31 | 32 | @requirement The class satisfies the following concept requirements: 33 | - 34 | [BidirectionalIterator](https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator): 35 | The iterator that can be moved can be moved in both directions (i.e. 36 | incremented and decremented). 37 | - [OutputIterator](https://en.cppreference.com/w/cpp/named_req/OutputIterator): 38 | It is possible to write to the pointed-to element (only if @a Base is 39 | @ref iterator). 40 | 41 | @since version 1.0.0 42 | */ 43 | template 44 | class json_reverse_iterator : public std::reverse_iterator 45 | { 46 | public: 47 | using difference_type = std::ptrdiff_t; 48 | /// shortcut to the reverse iterator adapter 49 | using base_iterator = std::reverse_iterator; 50 | /// the reference type for the pointed-to element 51 | using reference = typename Base::reference; 52 | 53 | /// create reverse iterator from iterator 54 | explicit json_reverse_iterator(const typename base_iterator::iterator_type& it) noexcept 55 | : base_iterator(it) {} 56 | 57 | /// create reverse iterator from base class 58 | explicit json_reverse_iterator(const base_iterator& it) noexcept : base_iterator(it) {} 59 | 60 | /// post-increment (it++) 61 | json_reverse_iterator operator++(int)& // NOLINT(cert-dcl21-cpp) 62 | { 63 | return static_cast(base_iterator::operator++(1)); 64 | } 65 | 66 | /// pre-increment (++it) 67 | json_reverse_iterator& operator++() 68 | { 69 | return static_cast(base_iterator::operator++()); 70 | } 71 | 72 | /// post-decrement (it--) 73 | json_reverse_iterator operator--(int)& // NOLINT(cert-dcl21-cpp) 74 | { 75 | return static_cast(base_iterator::operator--(1)); 76 | } 77 | 78 | /// pre-decrement (--it) 79 | json_reverse_iterator& operator--() 80 | { 81 | return static_cast(base_iterator::operator--()); 82 | } 83 | 84 | /// add to iterator 85 | json_reverse_iterator& operator+=(difference_type i) 86 | { 87 | return static_cast(base_iterator::operator+=(i)); 88 | } 89 | 90 | /// add to iterator 91 | json_reverse_iterator operator+(difference_type i) const 92 | { 93 | return static_cast(base_iterator::operator+(i)); 94 | } 95 | 96 | /// subtract from iterator 97 | json_reverse_iterator operator-(difference_type i) const 98 | { 99 | return static_cast(base_iterator::operator-(i)); 100 | } 101 | 102 | /// return difference 103 | difference_type operator-(const json_reverse_iterator& other) const 104 | { 105 | return base_iterator(*this) - base_iterator(other); 106 | } 107 | 108 | /// access to successor 109 | reference operator[](difference_type n) const 110 | { 111 | return *(this->operator+(n)); 112 | } 113 | 114 | /// return the key of an object iterator 115 | auto key() const -> decltype(std::declval().key()) 116 | { 117 | auto it = --this->base(); 118 | return it.key(); 119 | } 120 | 121 | /// return the value of an iterator 122 | reference value() const 123 | { 124 | auto it = --this->base(); 125 | return it.operator * (); 126 | } 127 | }; 128 | 129 | } // namespace detail 130 | NLOHMANN_JSON_NAMESPACE_END 131 | -------------------------------------------------------------------------------- /include/nlohmann/detail/iterators/primitive_iterator.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // ptrdiff_t 12 | #include // numeric_limits 13 | 14 | #include 15 | 16 | NLOHMANN_JSON_NAMESPACE_BEGIN 17 | namespace detail 18 | { 19 | 20 | /* 21 | @brief an iterator for primitive JSON types 22 | 23 | This class models an iterator for primitive JSON types (boolean, number, 24 | string). It's only purpose is to allow the iterator/const_iterator classes 25 | to "iterate" over primitive values. Internally, the iterator is modeled by 26 | a `difference_type` variable. Value begin_value (`0`) models the begin, 27 | end_value (`1`) models past the end. 28 | */ 29 | class primitive_iterator_t 30 | { 31 | private: 32 | using difference_type = std::ptrdiff_t; 33 | static constexpr difference_type begin_value = 0; 34 | static constexpr difference_type end_value = begin_value + 1; 35 | 36 | JSON_PRIVATE_UNLESS_TESTED: 37 | /// iterator as signed integer type 38 | difference_type m_it = (std::numeric_limits::min)(); 39 | 40 | public: 41 | constexpr difference_type get_value() const noexcept 42 | { 43 | return m_it; 44 | } 45 | 46 | /// set iterator to a defined beginning 47 | void set_begin() noexcept 48 | { 49 | m_it = begin_value; 50 | } 51 | 52 | /// set iterator to a defined past the end 53 | void set_end() noexcept 54 | { 55 | m_it = end_value; 56 | } 57 | 58 | /// return whether the iterator can be dereferenced 59 | constexpr bool is_begin() const noexcept 60 | { 61 | return m_it == begin_value; 62 | } 63 | 64 | /// return whether the iterator is at end 65 | constexpr bool is_end() const noexcept 66 | { 67 | return m_it == end_value; 68 | } 69 | 70 | friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 71 | { 72 | return lhs.m_it == rhs.m_it; 73 | } 74 | 75 | friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 76 | { 77 | return lhs.m_it < rhs.m_it; 78 | } 79 | 80 | primitive_iterator_t operator+(difference_type n) noexcept 81 | { 82 | auto result = *this; 83 | result += n; 84 | return result; 85 | } 86 | 87 | friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept 88 | { 89 | return lhs.m_it - rhs.m_it; 90 | } 91 | 92 | primitive_iterator_t& operator++() noexcept 93 | { 94 | ++m_it; 95 | return *this; 96 | } 97 | 98 | primitive_iterator_t operator++(int)& noexcept // NOLINT(cert-dcl21-cpp) 99 | { 100 | auto result = *this; 101 | ++m_it; 102 | return result; 103 | } 104 | 105 | primitive_iterator_t& operator--() noexcept 106 | { 107 | --m_it; 108 | return *this; 109 | } 110 | 111 | primitive_iterator_t operator--(int)& noexcept // NOLINT(cert-dcl21-cpp) 112 | { 113 | auto result = *this; 114 | --m_it; 115 | return result; 116 | } 117 | 118 | primitive_iterator_t& operator+=(difference_type n) noexcept 119 | { 120 | m_it += n; 121 | return *this; 122 | } 123 | 124 | primitive_iterator_t& operator-=(difference_type n) noexcept 125 | { 126 | m_it -= n; 127 | return *this; 128 | } 129 | }; 130 | 131 | } // namespace detail 132 | NLOHMANN_JSON_NAMESPACE_END 133 | -------------------------------------------------------------------------------- /include/nlohmann/detail/json_custom_base_class.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // conditional, is_same 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | /*! 20 | @brief Default base class of the @ref basic_json class. 21 | 22 | So that the correct implementations of the copy / move ctors / assign operators 23 | of @ref basic_json do not require complex case distinctions 24 | (no base class / custom base class used as customization point), 25 | @ref basic_json always has a base class. 26 | By default, this class is used because it is empty and thus has no effect 27 | on the behavior of @ref basic_json. 28 | */ 29 | struct json_default_base {}; 30 | 31 | template 32 | using json_base_class = typename std::conditional < 33 | std::is_same::value, 34 | json_default_base, 35 | T 36 | >::type; 37 | 38 | } // namespace detail 39 | NLOHMANN_JSON_NAMESPACE_END 40 | -------------------------------------------------------------------------------- /include/nlohmann/detail/json_ref.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | NLOHMANN_JSON_NAMESPACE_BEGIN 18 | namespace detail 19 | { 20 | 21 | template 22 | class json_ref 23 | { 24 | public: 25 | using value_type = BasicJsonType; 26 | 27 | json_ref(value_type&& value) 28 | : owned_value(std::move(value)) 29 | {} 30 | 31 | json_ref(const value_type& value) 32 | : value_ref(&value) 33 | {} 34 | 35 | json_ref(std::initializer_list init) 36 | : owned_value(init) 37 | {} 38 | 39 | template < 40 | class... Args, 41 | enable_if_t::value, int> = 0 > 42 | json_ref(Args && ... args) 43 | : owned_value(std::forward(args)...) 44 | {} 45 | 46 | // class should be movable only 47 | json_ref(json_ref&&) noexcept = default; 48 | json_ref(const json_ref&) = delete; 49 | json_ref& operator=(const json_ref&) = delete; 50 | json_ref& operator=(json_ref&&) = delete; 51 | ~json_ref() = default; 52 | 53 | value_type moved_or_copied() const 54 | { 55 | if (value_ref == nullptr) 56 | { 57 | return std::move(owned_value); 58 | } 59 | return *value_ref; 60 | } 61 | 62 | value_type const& operator*() const 63 | { 64 | return value_ref ? *value_ref : owned_value; 65 | } 66 | 67 | value_type const* operator->() const 68 | { 69 | return &** this; 70 | } 71 | 72 | private: 73 | mutable value_type owned_value = nullptr; 74 | value_type const* value_ref = nullptr; 75 | }; 76 | 77 | } // namespace detail 78 | NLOHMANN_JSON_NAMESPACE_END 79 | -------------------------------------------------------------------------------- /include/nlohmann/detail/macro_unscope.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | // restore clang diagnostic settings 12 | #if defined(__clang__) 13 | #pragma clang diagnostic pop 14 | #endif 15 | 16 | // clean up 17 | #undef JSON_ASSERT 18 | #undef JSON_INTERNAL_CATCH 19 | #undef JSON_THROW 20 | #undef JSON_PRIVATE_UNLESS_TESTED 21 | #undef NLOHMANN_BASIC_JSON_TPL_DECLARATION 22 | #undef NLOHMANN_BASIC_JSON_TPL 23 | #undef JSON_EXPLICIT 24 | #undef NLOHMANN_CAN_CALL_STD_FUNC_IMPL 25 | #undef JSON_INLINE_VARIABLE 26 | #undef JSON_NO_UNIQUE_ADDRESS 27 | #undef JSON_DISABLE_ENUM_SERIALIZATION 28 | #undef JSON_USE_GLOBAL_UDLS 29 | 30 | #ifndef JSON_TEST_KEEP_MACROS 31 | #undef JSON_CATCH 32 | #undef JSON_TRY 33 | #undef JSON_HAS_CPP_11 34 | #undef JSON_HAS_CPP_14 35 | #undef JSON_HAS_CPP_17 36 | #undef JSON_HAS_CPP_20 37 | #undef JSON_HAS_CPP_23 38 | #undef JSON_HAS_FILESYSTEM 39 | #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM 40 | #undef JSON_HAS_THREE_WAY_COMPARISON 41 | #undef JSON_HAS_RANGES 42 | #undef JSON_HAS_STATIC_RTTI 43 | #undef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 44 | #endif 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/call_std/begin.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/call_std/end.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); 16 | 17 | NLOHMANN_JSON_NAMESPACE_END 18 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/cpp_future.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-FileCopyrightText: 2018 The Abseil Authors 8 | // SPDX-License-Identifier: MIT 9 | 10 | #pragma once 11 | 12 | #include // array 13 | #include // size_t 14 | #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type 15 | #include // index_sequence, make_index_sequence, index_sequence_for 16 | 17 | #include 18 | 19 | NLOHMANN_JSON_NAMESPACE_BEGIN 20 | namespace detail 21 | { 22 | 23 | template 24 | using uncvref_t = typename std::remove_cv::type>::type; 25 | 26 | #ifdef JSON_HAS_CPP_14 27 | 28 | // the following utilities are natively available in C++14 29 | using std::enable_if_t; 30 | using std::index_sequence; 31 | using std::make_index_sequence; 32 | using std::index_sequence_for; 33 | 34 | #else 35 | 36 | // alias templates to reduce boilerplate 37 | template 38 | using enable_if_t = typename std::enable_if::type; 39 | 40 | // The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h 41 | // which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. 42 | 43 | //// START OF CODE FROM GOOGLE ABSEIL 44 | 45 | // integer_sequence 46 | // 47 | // Class template representing a compile-time integer sequence. An instantiation 48 | // of `integer_sequence` has a sequence of integers encoded in its 49 | // type through its template arguments (which is a common need when 50 | // working with C++11 variadic templates). `absl::integer_sequence` is designed 51 | // to be a drop-in replacement for C++14's `std::integer_sequence`. 52 | // 53 | // Example: 54 | // 55 | // template< class T, T... Ints > 56 | // void user_function(integer_sequence); 57 | // 58 | // int main() 59 | // { 60 | // // user_function's `T` will be deduced to `int` and `Ints...` 61 | // // will be deduced to `0, 1, 2, 3, 4`. 62 | // user_function(make_integer_sequence()); 63 | // } 64 | template 65 | struct integer_sequence 66 | { 67 | using value_type = T; 68 | static constexpr std::size_t size() noexcept 69 | { 70 | return sizeof...(Ints); 71 | } 72 | }; 73 | 74 | // index_sequence 75 | // 76 | // A helper template for an `integer_sequence` of `size_t`, 77 | // `absl::index_sequence` is designed to be a drop-in replacement for C++14's 78 | // `std::index_sequence`. 79 | template 80 | using index_sequence = integer_sequence; 81 | 82 | namespace utility_internal 83 | { 84 | 85 | template 86 | struct Extend; 87 | 88 | // Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. 89 | template 90 | struct Extend, SeqSize, 0> 91 | { 92 | using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; 93 | }; 94 | 95 | template 96 | struct Extend, SeqSize, 1> 97 | { 98 | using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; 99 | }; 100 | 101 | // Recursion helper for 'make_integer_sequence'. 102 | // 'Gen::type' is an alias for 'integer_sequence'. 103 | template 104 | struct Gen 105 | { 106 | using type = 107 | typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; 108 | }; 109 | 110 | template 111 | struct Gen 112 | { 113 | using type = integer_sequence; 114 | }; 115 | 116 | } // namespace utility_internal 117 | 118 | // Compile-time sequences of integers 119 | 120 | // make_integer_sequence 121 | // 122 | // This template alias is equivalent to 123 | // `integer_sequence`, and is designed to be a drop-in 124 | // replacement for C++14's `std::make_integer_sequence`. 125 | template 126 | using make_integer_sequence = typename utility_internal::Gen::type; 127 | 128 | // make_index_sequence 129 | // 130 | // This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, 131 | // and is designed to be a drop-in replacement for C++14's 132 | // `std::make_index_sequence`. 133 | template 134 | using make_index_sequence = make_integer_sequence; 135 | 136 | // index_sequence_for 137 | // 138 | // Converts a typename pack into an index sequence of the same length, and 139 | // is designed to be a drop-in replacement for C++14's 140 | // `std::index_sequence_for()` 141 | template 142 | using index_sequence_for = make_index_sequence; 143 | 144 | //// END OF CODE FROM GOOGLE ABSEIL 145 | 146 | #endif 147 | 148 | // dispatch utility (taken from ranges-v3) 149 | template struct priority_tag : priority_tag < N - 1 > {}; 150 | template<> struct priority_tag<0> {}; 151 | 152 | // taken from ranges-v3 153 | template 154 | struct static_const 155 | { 156 | static JSON_INLINE_VARIABLE constexpr T value{}; 157 | }; 158 | 159 | #ifndef JSON_HAS_CPP_17 160 | template 161 | constexpr T static_const::value; 162 | #endif 163 | 164 | template 165 | constexpr std::array make_array(Args&& ... args) 166 | { 167 | return std::array {{static_cast(std::forward(args))...}}; 168 | } 169 | 170 | } // namespace detail 171 | NLOHMANN_JSON_NAMESPACE_END 172 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/detected.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include 14 | 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | 19 | // https://en.cppreference.com/w/cpp/experimental/is_detected 20 | struct nonesuch 21 | { 22 | nonesuch() = delete; 23 | ~nonesuch() = delete; 24 | nonesuch(nonesuch const&) = delete; 25 | nonesuch(nonesuch const&&) = delete; 26 | void operator=(nonesuch const&) = delete; 27 | void operator=(nonesuch&&) = delete; 28 | }; 29 | 30 | template class Op, 33 | class... Args> 34 | struct detector 35 | { 36 | using value_t = std::false_type; 37 | using type = Default; 38 | }; 39 | 40 | template class Op, class... Args> 41 | struct detector>, Op, Args...> 42 | { 43 | using value_t = std::true_type; 44 | using type = Op; 45 | }; 46 | 47 | template class Op, class... Args> 48 | using is_detected = typename detector::value_t; 49 | 50 | template class Op, class... Args> 51 | struct is_detected_lazy : is_detected { }; 52 | 53 | template class Op, class... Args> 54 | using detected_t = typename detector::type; 55 | 56 | template class Op, class... Args> 57 | using detected_or = detector; 58 | 59 | template class Op, class... Args> 60 | using detected_or_t = typename detected_or::type; 61 | 62 | template class Op, class... Args> 63 | using is_detected_exact = std::is_same>; 64 | 65 | template class Op, class... Args> 66 | using is_detected_convertible = 67 | std::is_convertible, To>; 68 | 69 | } // namespace detail 70 | NLOHMANN_JSON_NAMESPACE_END 71 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/identity_tag.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | // dispatching helper struct 18 | template struct identity_tag {}; 19 | 20 | } // namespace detail 21 | NLOHMANN_JSON_NAMESPACE_END 22 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/is_sax.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | #include // declval 13 | #include // string 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | NLOHMANN_JSON_NAMESPACE_BEGIN 20 | namespace detail 21 | { 22 | 23 | template 24 | using null_function_t = decltype(std::declval().null()); 25 | 26 | template 27 | using boolean_function_t = 28 | decltype(std::declval().boolean(std::declval())); 29 | 30 | template 31 | using number_integer_function_t = 32 | decltype(std::declval().number_integer(std::declval())); 33 | 34 | template 35 | using number_unsigned_function_t = 36 | decltype(std::declval().number_unsigned(std::declval())); 37 | 38 | template 39 | using number_float_function_t = decltype(std::declval().number_float( 40 | std::declval(), std::declval())); 41 | 42 | template 43 | using string_function_t = 44 | decltype(std::declval().string(std::declval())); 45 | 46 | template 47 | using binary_function_t = 48 | decltype(std::declval().binary(std::declval())); 49 | 50 | template 51 | using start_object_function_t = 52 | decltype(std::declval().start_object(std::declval())); 53 | 54 | template 55 | using key_function_t = 56 | decltype(std::declval().key(std::declval())); 57 | 58 | template 59 | using end_object_function_t = decltype(std::declval().end_object()); 60 | 61 | template 62 | using start_array_function_t = 63 | decltype(std::declval().start_array(std::declval())); 64 | 65 | template 66 | using end_array_function_t = decltype(std::declval().end_array()); 67 | 68 | template 69 | using parse_error_function_t = decltype(std::declval().parse_error( 70 | std::declval(), std::declval(), 71 | std::declval())); 72 | 73 | template 74 | struct is_sax 75 | { 76 | private: 77 | static_assert(is_basic_json::value, 78 | "BasicJsonType must be of type basic_json<...>"); 79 | 80 | using number_integer_t = typename BasicJsonType::number_integer_t; 81 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 82 | using number_float_t = typename BasicJsonType::number_float_t; 83 | using string_t = typename BasicJsonType::string_t; 84 | using binary_t = typename BasicJsonType::binary_t; 85 | using exception_t = typename BasicJsonType::exception; 86 | 87 | public: 88 | static constexpr bool value = 89 | is_detected_exact::value && 90 | is_detected_exact::value && 91 | is_detected_exact::value && 92 | is_detected_exact::value && 93 | is_detected_exact::value && 94 | is_detected_exact::value && 95 | is_detected_exact::value && 96 | is_detected_exact::value && 97 | is_detected_exact::value && 98 | is_detected_exact::value && 99 | is_detected_exact::value && 100 | is_detected_exact::value && 101 | is_detected_exact::value; 102 | }; 103 | 104 | template 105 | struct is_sax_static_asserts 106 | { 107 | private: 108 | static_assert(is_basic_json::value, 109 | "BasicJsonType must be of type basic_json<...>"); 110 | 111 | using number_integer_t = typename BasicJsonType::number_integer_t; 112 | using number_unsigned_t = typename BasicJsonType::number_unsigned_t; 113 | using number_float_t = typename BasicJsonType::number_float_t; 114 | using string_t = typename BasicJsonType::string_t; 115 | using binary_t = typename BasicJsonType::binary_t; 116 | using exception_t = typename BasicJsonType::exception; 117 | 118 | public: 119 | static_assert(is_detected_exact::value, 120 | "Missing/invalid function: bool null()"); 121 | static_assert(is_detected_exact::value, 122 | "Missing/invalid function: bool boolean(bool)"); 123 | static_assert(is_detected_exact::value, 124 | "Missing/invalid function: bool boolean(bool)"); 125 | static_assert( 126 | is_detected_exact::value, 128 | "Missing/invalid function: bool number_integer(number_integer_t)"); 129 | static_assert( 130 | is_detected_exact::value, 132 | "Missing/invalid function: bool number_unsigned(number_unsigned_t)"); 133 | static_assert(is_detected_exact::value, 135 | "Missing/invalid function: bool number_float(number_float_t, const string_t&)"); 136 | static_assert( 137 | is_detected_exact::value, 138 | "Missing/invalid function: bool string(string_t&)"); 139 | static_assert( 140 | is_detected_exact::value, 141 | "Missing/invalid function: bool binary(binary_t&)"); 142 | static_assert(is_detected_exact::value, 143 | "Missing/invalid function: bool start_object(std::size_t)"); 144 | static_assert(is_detected_exact::value, 145 | "Missing/invalid function: bool key(string_t&)"); 146 | static_assert(is_detected_exact::value, 147 | "Missing/invalid function: bool end_object()"); 148 | static_assert(is_detected_exact::value, 149 | "Missing/invalid function: bool start_array(std::size_t)"); 150 | static_assert(is_detected_exact::value, 151 | "Missing/invalid function: bool end_array()"); 152 | static_assert( 153 | is_detected_exact::value, 154 | "Missing/invalid function: bool parse_error(std::size_t, const " 155 | "std::string&, const exception&)"); 156 | }; 157 | 158 | } // namespace detail 159 | NLOHMANN_JSON_NAMESPACE_END 160 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/std_fs.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #if JSON_HAS_EXPERIMENTAL_FILESYSTEM 14 | #include 15 | NLOHMANN_JSON_NAMESPACE_BEGIN 16 | namespace detail 17 | { 18 | namespace std_fs = std::experimental::filesystem; 19 | } // namespace detail 20 | NLOHMANN_JSON_NAMESPACE_END 21 | #elif JSON_HAS_FILESYSTEM 22 | #include // NOLINT(build/c++17) 23 | NLOHMANN_JSON_NAMESPACE_BEGIN 24 | namespace detail 25 | { 26 | namespace std_fs = std::filesystem; 27 | } // namespace detail 28 | NLOHMANN_JSON_NAMESPACE_END 29 | #endif 30 | -------------------------------------------------------------------------------- /include/nlohmann/detail/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | template struct make_void 18 | { 19 | using type = void; 20 | }; 21 | template using void_t = typename make_void::type; 22 | 23 | } // namespace detail 24 | NLOHMANN_JSON_NAMESPACE_END 25 | -------------------------------------------------------------------------------- /include/nlohmann/detail/output/output_adapters.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // copy 12 | #include // size_t 13 | #include // back_inserter 14 | #include // shared_ptr, make_shared 15 | #include // basic_string 16 | #include // vector 17 | 18 | #ifndef JSON_NO_IO 19 | #include // streamsize 20 | #include // basic_ostream 21 | #endif // JSON_NO_IO 22 | 23 | #include 24 | 25 | NLOHMANN_JSON_NAMESPACE_BEGIN 26 | namespace detail 27 | { 28 | 29 | /// abstract output adapter interface 30 | template struct output_adapter_protocol 31 | { 32 | virtual void write_character(CharType c) = 0; 33 | virtual void write_characters(const CharType* s, std::size_t length) = 0; 34 | virtual ~output_adapter_protocol() = default; 35 | 36 | output_adapter_protocol() = default; 37 | output_adapter_protocol(const output_adapter_protocol&) = default; 38 | output_adapter_protocol(output_adapter_protocol&&) noexcept = default; 39 | output_adapter_protocol& operator=(const output_adapter_protocol&) = default; 40 | output_adapter_protocol& operator=(output_adapter_protocol&&) noexcept = default; 41 | }; 42 | 43 | /// a type to simplify interfaces 44 | template 45 | using output_adapter_t = std::shared_ptr>; 46 | 47 | /// output adapter for byte vectors 48 | template> 49 | class output_vector_adapter : public output_adapter_protocol 50 | { 51 | public: 52 | explicit output_vector_adapter(std::vector& vec) noexcept 53 | : v(vec) 54 | {} 55 | 56 | void write_character(CharType c) override 57 | { 58 | v.push_back(c); 59 | } 60 | 61 | JSON_HEDLEY_NON_NULL(2) 62 | void write_characters(const CharType* s, std::size_t length) override 63 | { 64 | v.insert(v.end(), s, s + length); 65 | } 66 | 67 | private: 68 | std::vector& v; 69 | }; 70 | 71 | #ifndef JSON_NO_IO 72 | /// output adapter for output streams 73 | template 74 | class output_stream_adapter : public output_adapter_protocol 75 | { 76 | public: 77 | explicit output_stream_adapter(std::basic_ostream& s) noexcept 78 | : stream(s) 79 | {} 80 | 81 | void write_character(CharType c) override 82 | { 83 | stream.put(c); 84 | } 85 | 86 | JSON_HEDLEY_NON_NULL(2) 87 | void write_characters(const CharType* s, std::size_t length) override 88 | { 89 | stream.write(s, static_cast(length)); 90 | } 91 | 92 | private: 93 | std::basic_ostream& stream; 94 | }; 95 | #endif // JSON_NO_IO 96 | 97 | /// output adapter for basic_string 98 | template> 99 | class output_string_adapter : public output_adapter_protocol 100 | { 101 | public: 102 | explicit output_string_adapter(StringType& s) noexcept 103 | : str(s) 104 | {} 105 | 106 | void write_character(CharType c) override 107 | { 108 | str.push_back(c); 109 | } 110 | 111 | JSON_HEDLEY_NON_NULL(2) 112 | void write_characters(const CharType* s, std::size_t length) override 113 | { 114 | str.append(s, length); 115 | } 116 | 117 | private: 118 | StringType& str; 119 | }; 120 | 121 | template> 122 | class output_adapter 123 | { 124 | public: 125 | template> 126 | output_adapter(std::vector& vec) 127 | : oa(std::make_shared>(vec)) {} 128 | 129 | #ifndef JSON_NO_IO 130 | output_adapter(std::basic_ostream& s) 131 | : oa(std::make_shared>(s)) {} 132 | #endif // JSON_NO_IO 133 | 134 | output_adapter(StringType& s) 135 | : oa(std::make_shared>(s)) {} 136 | 137 | operator output_adapter_t() 138 | { 139 | return oa; 140 | } 141 | 142 | private: 143 | output_adapter_t oa = nullptr; 144 | }; 145 | 146 | } // namespace detail 147 | NLOHMANN_JSON_NAMESPACE_END 148 | -------------------------------------------------------------------------------- /include/nlohmann/detail/string_concat.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // strlen 12 | #include // string 13 | #include // forward 14 | 15 | #include 16 | #include 17 | 18 | NLOHMANN_JSON_NAMESPACE_BEGIN 19 | namespace detail 20 | { 21 | 22 | inline std::size_t concat_length() 23 | { 24 | return 0; 25 | } 26 | 27 | template 28 | inline std::size_t concat_length(const char* cstr, const Args& ... rest); 29 | 30 | template 31 | inline std::size_t concat_length(const StringType& str, const Args& ... rest); 32 | 33 | template 34 | inline std::size_t concat_length(const char /*c*/, const Args& ... rest) 35 | { 36 | return 1 + concat_length(rest...); 37 | } 38 | 39 | template 40 | inline std::size_t concat_length(const char* cstr, const Args& ... rest) 41 | { 42 | // cppcheck-suppress ignoredReturnValue 43 | return ::strlen(cstr) + concat_length(rest...); 44 | } 45 | 46 | template 47 | inline std::size_t concat_length(const StringType& str, const Args& ... rest) 48 | { 49 | return str.size() + concat_length(rest...); 50 | } 51 | 52 | template 53 | inline void concat_into(OutStringType& /*out*/) 54 | {} 55 | 56 | template 57 | using string_can_append = decltype(std::declval().append(std::declval < Arg && > ())); 58 | 59 | template 60 | using detect_string_can_append = is_detected; 61 | 62 | template 63 | using string_can_append_op = decltype(std::declval() += std::declval < Arg && > ()); 64 | 65 | template 66 | using detect_string_can_append_op = is_detected; 67 | 68 | template 69 | using string_can_append_iter = decltype(std::declval().append(std::declval().begin(), std::declval().end())); 70 | 71 | template 72 | using detect_string_can_append_iter = is_detected; 73 | 74 | template 75 | using string_can_append_data = decltype(std::declval().append(std::declval().data(), std::declval().size())); 76 | 77 | template 78 | using detect_string_can_append_data = is_detected; 79 | 80 | template < typename OutStringType, typename Arg, typename... Args, 81 | enable_if_t < !detect_string_can_append::value 82 | && detect_string_can_append_op::value, int > = 0 > 83 | inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest); 84 | 85 | template < typename OutStringType, typename Arg, typename... Args, 86 | enable_if_t < !detect_string_can_append::value 87 | && !detect_string_can_append_op::value 88 | && detect_string_can_append_iter::value, int > = 0 > 89 | inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest); 90 | 91 | template < typename OutStringType, typename Arg, typename... Args, 92 | enable_if_t < !detect_string_can_append::value 93 | && !detect_string_can_append_op::value 94 | && !detect_string_can_append_iter::value 95 | && detect_string_can_append_data::value, int > = 0 > 96 | inline void concat_into(OutStringType& out, const Arg& arg, Args && ... rest); 97 | 98 | template::value, int> = 0> 100 | inline void concat_into(OutStringType& out, Arg && arg, Args && ... rest) 101 | { 102 | out.append(std::forward(arg)); 103 | concat_into(out, std::forward(rest)...); 104 | } 105 | 106 | template < typename OutStringType, typename Arg, typename... Args, 107 | enable_if_t < !detect_string_can_append::value 108 | && detect_string_can_append_op::value, int > > 109 | inline void concat_into(OutStringType& out, Arg&& arg, Args&& ... rest) 110 | { 111 | out += std::forward(arg); 112 | concat_into(out, std::forward(rest)...); 113 | } 114 | 115 | template < typename OutStringType, typename Arg, typename... Args, 116 | enable_if_t < !detect_string_can_append::value 117 | && !detect_string_can_append_op::value 118 | && detect_string_can_append_iter::value, int > > 119 | inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest) 120 | { 121 | out.append(arg.begin(), arg.end()); 122 | concat_into(out, std::forward(rest)...); 123 | } 124 | 125 | template < typename OutStringType, typename Arg, typename... Args, 126 | enable_if_t < !detect_string_can_append::value 127 | && !detect_string_can_append_op::value 128 | && !detect_string_can_append_iter::value 129 | && detect_string_can_append_data::value, int > > 130 | inline void concat_into(OutStringType& out, const Arg& arg, Args&& ... rest) 131 | { 132 | out.append(arg.data(), arg.size()); 133 | concat_into(out, std::forward(rest)...); 134 | } 135 | 136 | template 137 | inline OutStringType concat(Args && ... args) 138 | { 139 | OutStringType str; 140 | str.reserve(concat_length(args...)); 141 | concat_into(str, std::forward(args)...); 142 | return str; 143 | } 144 | 145 | } // namespace detail 146 | NLOHMANN_JSON_NAMESPACE_END 147 | -------------------------------------------------------------------------------- /include/nlohmann/detail/string_escape.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | namespace detail 15 | { 16 | 17 | /*! 18 | @brief replace all occurrences of a substring by another string 19 | 20 | @param[in,out] s the string to manipulate; changed so that all 21 | occurrences of @a f are replaced with @a t 22 | @param[in] f the substring to replace with @a t 23 | @param[in] t the string to replace @a f 24 | 25 | @pre The search string @a f must not be empty. **This precondition is 26 | enforced with an assertion.** 27 | 28 | @since version 2.0.0 29 | */ 30 | template 31 | inline void replace_substring(StringType& s, const StringType& f, 32 | const StringType& t) 33 | { 34 | JSON_ASSERT(!f.empty()); 35 | for (auto pos = s.find(f); // find first occurrence of f 36 | pos != StringType::npos; // make sure f was found 37 | s.replace(pos, f.size(), t), // replace with t, and 38 | pos = s.find(f, pos + t.size())) // find next occurrence of f 39 | {} 40 | } 41 | 42 | /*! 43 | * @brief string escaping as described in RFC 6901 (Sect. 4) 44 | * @param[in] s string to escape 45 | * @return escaped string 46 | * 47 | * Note the order of escaping "~" to "~0" and "/" to "~1" is important. 48 | */ 49 | template 50 | inline StringType escape(StringType s) 51 | { 52 | replace_substring(s, StringType{"~"}, StringType{"~0"}); 53 | replace_substring(s, StringType{"/"}, StringType{"~1"}); 54 | return s; 55 | } 56 | 57 | /*! 58 | * @brief string unescaping as described in RFC 6901 (Sect. 4) 59 | * @param[in] s string to unescape 60 | * @return unescaped string 61 | * 62 | * Note the order of escaping "~1" to "/" and "~0" to "~" is important. 63 | */ 64 | template 65 | static void unescape(StringType& s) 66 | { 67 | replace_substring(s, StringType{"~1"}, StringType{"/"}); 68 | replace_substring(s, StringType{"~0"}, StringType{"~"}); 69 | } 70 | 71 | } // namespace detail 72 | NLOHMANN_JSON_NAMESPACE_END 73 | -------------------------------------------------------------------------------- /include/nlohmann/detail/string_utils.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // size_t 12 | #include // string, to_string 13 | 14 | #include 15 | 16 | NLOHMANN_JSON_NAMESPACE_BEGIN 17 | namespace detail 18 | { 19 | 20 | template 21 | void int_to_string(StringType& target, std::size_t value) 22 | { 23 | // For ADL 24 | using std::to_string; 25 | target = to_string(value); 26 | } 27 | 28 | template 29 | StringType to_string(std::size_t value) 30 | { 31 | StringType result; 32 | int_to_string(result, value); 33 | return result; 34 | } 35 | 36 | } // namespace detail 37 | NLOHMANN_JSON_NAMESPACE_END 38 | -------------------------------------------------------------------------------- /include/nlohmann/detail/value_t.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #include // array 12 | #include // size_t 13 | #include // uint8_t 14 | #include // string 15 | 16 | #include 17 | #if JSON_HAS_THREE_WAY_COMPARISON 18 | #include // partial_ordering 19 | #endif 20 | 21 | NLOHMANN_JSON_NAMESPACE_BEGIN 22 | namespace detail 23 | { 24 | 25 | /////////////////////////// 26 | // JSON type enumeration // 27 | /////////////////////////// 28 | 29 | /*! 30 | @brief the JSON type enumeration 31 | 32 | This enumeration collects the different JSON types. It is internally used to 33 | distinguish the stored values, and the functions @ref basic_json::is_null(), 34 | @ref basic_json::is_object(), @ref basic_json::is_array(), 35 | @ref basic_json::is_string(), @ref basic_json::is_boolean(), 36 | @ref basic_json::is_number() (with @ref basic_json::is_number_integer(), 37 | @ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), 38 | @ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and 39 | @ref basic_json::is_structured() rely on it. 40 | 41 | @note There are three enumeration entries (number_integer, number_unsigned, and 42 | number_float), because the library distinguishes these three types for numbers: 43 | @ref basic_json::number_unsigned_t is used for unsigned integers, 44 | @ref basic_json::number_integer_t is used for signed integers, and 45 | @ref basic_json::number_float_t is used for floating-point numbers or to 46 | approximate integers which do not fit in the limits of their respective type. 47 | 48 | @sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON 49 | value with the default value for a given type 50 | 51 | @since version 1.0.0 52 | */ 53 | enum class value_t : std::uint8_t 54 | { 55 | null, ///< null value 56 | object, ///< object (unordered set of name/value pairs) 57 | array, ///< array (ordered collection of values) 58 | string, ///< string value 59 | boolean, ///< boolean value 60 | number_integer, ///< number value (signed integer) 61 | number_unsigned, ///< number value (unsigned integer) 62 | number_float, ///< number value (floating-point) 63 | binary, ///< binary array (ordered collection of bytes) 64 | discarded ///< discarded by the parser callback function 65 | }; 66 | 67 | /*! 68 | @brief comparison operator for JSON types 69 | 70 | Returns an ordering that is similar to Python: 71 | - order: null < boolean < number < object < array < string < binary 72 | - furthermore, each type is not smaller than itself 73 | - discarded values are not comparable 74 | - binary is represented as a b"" string in python and directly comparable to a 75 | string; however, making a binary array directly comparable with a string would 76 | be surprising behavior in a JSON file. 77 | 78 | @since version 1.0.0 79 | */ 80 | #if JSON_HAS_THREE_WAY_COMPARISON 81 | inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* 82 | #else 83 | inline bool operator<(const value_t lhs, const value_t rhs) noexcept 84 | #endif 85 | { 86 | static constexpr std::array order = {{ 87 | 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, 88 | 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, 89 | 6 /* binary */ 90 | } 91 | }; 92 | 93 | const auto l_index = static_cast(lhs); 94 | const auto r_index = static_cast(rhs); 95 | #if JSON_HAS_THREE_WAY_COMPARISON 96 | if (l_index < order.size() && r_index < order.size()) 97 | { 98 | return order[l_index] <=> order[r_index]; // *NOPAD* 99 | } 100 | return std::partial_ordering::unordered; 101 | #else 102 | return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; 103 | #endif 104 | } 105 | 106 | // GCC selects the built-in operator< over an operator rewritten from 107 | // a user-defined spaceship operator 108 | // Clang, MSVC, and ICC select the rewritten candidate 109 | // (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) 110 | #if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) 111 | inline bool operator<(const value_t lhs, const value_t rhs) noexcept 112 | { 113 | return std::is_lt(lhs <=> rhs); // *NOPAD* 114 | } 115 | #endif 116 | 117 | } // namespace detail 118 | NLOHMANN_JSON_NAMESPACE_END 119 | -------------------------------------------------------------------------------- /include/nlohmann/json_fwd.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ 10 | #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ 11 | 12 | #include // int64_t, uint64_t 13 | #include // map 14 | #include // allocator 15 | #include // string 16 | #include // vector 17 | 18 | #include 19 | 20 | /*! 21 | @brief namespace for Niels Lohmann 22 | @see https://github.com/nlohmann 23 | @since version 1.0.0 24 | */ 25 | NLOHMANN_JSON_NAMESPACE_BEGIN 26 | 27 | /*! 28 | @brief default JSONSerializer template argument 29 | 30 | This serializer ignores the template arguments and uses ADL 31 | ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) 32 | for serialization. 33 | */ 34 | template 35 | struct adl_serializer; 36 | 37 | /// a class to store JSON values 38 | /// @sa https://json.nlohmann.me/api/basic_json/ 39 | template class ObjectType = 40 | std::map, 41 | template class ArrayType = std::vector, 42 | class StringType = std::string, class BooleanType = bool, 43 | class NumberIntegerType = std::int64_t, 44 | class NumberUnsignedType = std::uint64_t, 45 | class NumberFloatType = double, 46 | template class AllocatorType = std::allocator, 47 | template class JSONSerializer = 48 | adl_serializer, 49 | class BinaryType = std::vector, // cppcheck-suppress syntaxError 50 | class CustomBaseClass = void> 51 | class basic_json; 52 | 53 | /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document 54 | /// @sa https://json.nlohmann.me/api/json_pointer/ 55 | template 56 | class json_pointer; 57 | 58 | /*! 59 | @brief default specialization 60 | @sa https://json.nlohmann.me/api/json/ 61 | */ 62 | using json = basic_json<>; 63 | 64 | /// @brief a minimal map-like container that preserves insertion order 65 | /// @sa https://json.nlohmann.me/api/ordered_map/ 66 | template 67 | struct ordered_map; 68 | 69 | /// @brief specialization that maintains the insertion order of object keys 70 | /// @sa https://json.nlohmann.me/api/ordered_json/ 71 | using ordered_json = basic_json; 72 | 73 | NLOHMANN_JSON_NAMESPACE_END 74 | 75 | #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ 76 | -------------------------------------------------------------------------------- /include/nlohmann/thirdparty/hedley/hedley_undef.hpp: -------------------------------------------------------------------------------- 1 | // __ _____ _____ _____ 2 | // __| | __| | | | JSON for Modern C++ 3 | // | | |__ | | | | | | version 3.12.0 4 | // |_____|_____|_____|_|___| https://github.com/nlohmann/json 5 | // 6 | // SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann 7 | // SPDX-License-Identifier: MIT 8 | 9 | #pragma once 10 | 11 | #undef JSON_HEDLEY_ALWAYS_INLINE 12 | #undef JSON_HEDLEY_ARM_VERSION 13 | #undef JSON_HEDLEY_ARM_VERSION_CHECK 14 | #undef JSON_HEDLEY_ARRAY_PARAM 15 | #undef JSON_HEDLEY_ASSUME 16 | #undef JSON_HEDLEY_BEGIN_C_DECLS 17 | #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE 18 | #undef JSON_HEDLEY_CLANG_HAS_BUILTIN 19 | #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE 20 | #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE 21 | #undef JSON_HEDLEY_CLANG_HAS_EXTENSION 22 | #undef JSON_HEDLEY_CLANG_HAS_FEATURE 23 | #undef JSON_HEDLEY_CLANG_HAS_WARNING 24 | #undef JSON_HEDLEY_COMPCERT_VERSION 25 | #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK 26 | #undef JSON_HEDLEY_CONCAT 27 | #undef JSON_HEDLEY_CONCAT3 28 | #undef JSON_HEDLEY_CONCAT3_EX 29 | #undef JSON_HEDLEY_CONCAT_EX 30 | #undef JSON_HEDLEY_CONST 31 | #undef JSON_HEDLEY_CONSTEXPR 32 | #undef JSON_HEDLEY_CONST_CAST 33 | #undef JSON_HEDLEY_CPP_CAST 34 | #undef JSON_HEDLEY_CRAY_VERSION 35 | #undef JSON_HEDLEY_CRAY_VERSION_CHECK 36 | #undef JSON_HEDLEY_C_DECL 37 | #undef JSON_HEDLEY_DEPRECATED 38 | #undef JSON_HEDLEY_DEPRECATED_FOR 39 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL 40 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ 41 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED 42 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES 43 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS 44 | #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION 45 | #undef JSON_HEDLEY_DIAGNOSTIC_POP 46 | #undef JSON_HEDLEY_DIAGNOSTIC_PUSH 47 | #undef JSON_HEDLEY_DMC_VERSION 48 | #undef JSON_HEDLEY_DMC_VERSION_CHECK 49 | #undef JSON_HEDLEY_EMPTY_BASES 50 | #undef JSON_HEDLEY_EMSCRIPTEN_VERSION 51 | #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK 52 | #undef JSON_HEDLEY_END_C_DECLS 53 | #undef JSON_HEDLEY_FLAGS 54 | #undef JSON_HEDLEY_FLAGS_CAST 55 | #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE 56 | #undef JSON_HEDLEY_GCC_HAS_BUILTIN 57 | #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE 58 | #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE 59 | #undef JSON_HEDLEY_GCC_HAS_EXTENSION 60 | #undef JSON_HEDLEY_GCC_HAS_FEATURE 61 | #undef JSON_HEDLEY_GCC_HAS_WARNING 62 | #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK 63 | #undef JSON_HEDLEY_GCC_VERSION 64 | #undef JSON_HEDLEY_GCC_VERSION_CHECK 65 | #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE 66 | #undef JSON_HEDLEY_GNUC_HAS_BUILTIN 67 | #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE 68 | #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE 69 | #undef JSON_HEDLEY_GNUC_HAS_EXTENSION 70 | #undef JSON_HEDLEY_GNUC_HAS_FEATURE 71 | #undef JSON_HEDLEY_GNUC_HAS_WARNING 72 | #undef JSON_HEDLEY_GNUC_VERSION 73 | #undef JSON_HEDLEY_GNUC_VERSION_CHECK 74 | #undef JSON_HEDLEY_HAS_ATTRIBUTE 75 | #undef JSON_HEDLEY_HAS_BUILTIN 76 | #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE 77 | #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS 78 | #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE 79 | #undef JSON_HEDLEY_HAS_EXTENSION 80 | #undef JSON_HEDLEY_HAS_FEATURE 81 | #undef JSON_HEDLEY_HAS_WARNING 82 | #undef JSON_HEDLEY_IAR_VERSION 83 | #undef JSON_HEDLEY_IAR_VERSION_CHECK 84 | #undef JSON_HEDLEY_IBM_VERSION 85 | #undef JSON_HEDLEY_IBM_VERSION_CHECK 86 | #undef JSON_HEDLEY_IMPORT 87 | #undef JSON_HEDLEY_INLINE 88 | #undef JSON_HEDLEY_INTEL_CL_VERSION 89 | #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK 90 | #undef JSON_HEDLEY_INTEL_VERSION 91 | #undef JSON_HEDLEY_INTEL_VERSION_CHECK 92 | #undef JSON_HEDLEY_IS_CONSTANT 93 | #undef JSON_HEDLEY_IS_CONSTEXPR_ 94 | #undef JSON_HEDLEY_LIKELY 95 | #undef JSON_HEDLEY_MALLOC 96 | #undef JSON_HEDLEY_MCST_LCC_VERSION 97 | #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK 98 | #undef JSON_HEDLEY_MESSAGE 99 | #undef JSON_HEDLEY_MSVC_VERSION 100 | #undef JSON_HEDLEY_MSVC_VERSION_CHECK 101 | #undef JSON_HEDLEY_NEVER_INLINE 102 | #undef JSON_HEDLEY_NON_NULL 103 | #undef JSON_HEDLEY_NO_ESCAPE 104 | #undef JSON_HEDLEY_NO_RETURN 105 | #undef JSON_HEDLEY_NO_THROW 106 | #undef JSON_HEDLEY_NULL 107 | #undef JSON_HEDLEY_PELLES_VERSION 108 | #undef JSON_HEDLEY_PELLES_VERSION_CHECK 109 | #undef JSON_HEDLEY_PGI_VERSION 110 | #undef JSON_HEDLEY_PGI_VERSION_CHECK 111 | #undef JSON_HEDLEY_PREDICT 112 | #undef JSON_HEDLEY_PRINTF_FORMAT 113 | #undef JSON_HEDLEY_PRIVATE 114 | #undef JSON_HEDLEY_PUBLIC 115 | #undef JSON_HEDLEY_PURE 116 | #undef JSON_HEDLEY_REINTERPRET_CAST 117 | #undef JSON_HEDLEY_REQUIRE 118 | #undef JSON_HEDLEY_REQUIRE_CONSTEXPR 119 | #undef JSON_HEDLEY_REQUIRE_MSG 120 | #undef JSON_HEDLEY_RESTRICT 121 | #undef JSON_HEDLEY_RETURNS_NON_NULL 122 | #undef JSON_HEDLEY_SENTINEL 123 | #undef JSON_HEDLEY_STATIC_ASSERT 124 | #undef JSON_HEDLEY_STATIC_CAST 125 | #undef JSON_HEDLEY_STRINGIFY 126 | #undef JSON_HEDLEY_STRINGIFY_EX 127 | #undef JSON_HEDLEY_SUNPRO_VERSION 128 | #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK 129 | #undef JSON_HEDLEY_TINYC_VERSION 130 | #undef JSON_HEDLEY_TINYC_VERSION_CHECK 131 | #undef JSON_HEDLEY_TI_ARMCL_VERSION 132 | #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK 133 | #undef JSON_HEDLEY_TI_CL2000_VERSION 134 | #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK 135 | #undef JSON_HEDLEY_TI_CL430_VERSION 136 | #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK 137 | #undef JSON_HEDLEY_TI_CL6X_VERSION 138 | #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK 139 | #undef JSON_HEDLEY_TI_CL7X_VERSION 140 | #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK 141 | #undef JSON_HEDLEY_TI_CLPRU_VERSION 142 | #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK 143 | #undef JSON_HEDLEY_TI_VERSION 144 | #undef JSON_HEDLEY_TI_VERSION_CHECK 145 | #undef JSON_HEDLEY_UNAVAILABLE 146 | #undef JSON_HEDLEY_UNLIKELY 147 | #undef JSON_HEDLEY_UNPREDICTABLE 148 | #undef JSON_HEDLEY_UNREACHABLE 149 | #undef JSON_HEDLEY_UNREACHABLE_RETURN 150 | #undef JSON_HEDLEY_VERSION 151 | #undef JSON_HEDLEY_VERSION_DECODE_MAJOR 152 | #undef JSON_HEDLEY_VERSION_DECODE_MINOR 153 | #undef JSON_HEDLEY_VERSION_DECODE_REVISION 154 | #undef JSON_HEDLEY_VERSION_ENCODE 155 | #undef JSON_HEDLEY_WARNING 156 | #undef JSON_HEDLEY_WARN_UNUSED_RESULT 157 | #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG 158 | #undef JSON_HEDLEY_FALL_THROUGH 159 | -------------------------------------------------------------------------------- /pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "pch.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | -------------------------------------------------------------------------------- /pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /res/SWTools.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/res/SWTools.ico -------------------------------------------------------------------------------- /res/SWTools.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/King-zzk/Steam-Workshops-Tools-SWTools/b33dc4237c7cdb54013c649daa1f929008fd0f0b/res/SWTools.rc2 -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ 生成的包含文件。 3 | // 供 SWTools.rc 使用 4 | // 5 | #define IDM_ABOUTBOX 0x0010 6 | #define IDD_ABOUTBOX 100 7 | #define IDS_ABOUTBOX 101 8 | #define IDD_SWTOOLS_DIALOG 102 9 | #define IDR_MAINFRAME 128 10 | #define IDD_EULA_DIALOG 130 11 | #define IDD_ManyDownload 131 12 | #define IDD_Workshops_info 132 13 | #define IDC_EXITBTN 1000 14 | #define IDC_GITHUBBTN 1000 15 | #define IDC_APPSLT 1001 16 | #define IDC_COMBO1 1002 17 | #define IDC_LAUNCHBTN 1003 18 | #define IDC_EDIT2 1004 19 | #define IDC_ABOUTBTN 1005 20 | #define IDC_UPDATEBTN 1006 21 | #define IDC_FOLDERBTN 1007 22 | #define IDC_DASHBOARD 1008 23 | #define IDC_EDIT1 1009 24 | #define IDC_EULABTN 1010 25 | #define IDC_MANYDWNBTN 1011 26 | #define IDC_DECLINE 1012 27 | #define IDC_MANYDWNBTN2 1012 28 | #define IDC_ACCEPT 1013 29 | #define IDC_TEXT 1015 30 | #define IDC_MANYDWNLAUNCH 1019 31 | #define IDC_COMBO2 1020 32 | #define IDC_LIST1 1022 33 | 34 | // Next default values for new objects 35 | // 36 | #ifdef APSTUDIO_INVOKED 37 | #ifndef APSTUDIO_READONLY_SYMBOLS 38 | #define _APS_NEXT_RESOURCE_VALUE 135 39 | #define _APS_NEXT_COMMAND_VALUE 32771 40 | #define _APS_NEXT_CONTROL_VALUE 1023 41 | #define _APS_NEXT_SYMED_VALUE 101 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。 4 | 5 | //如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并 6 | // 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。 7 | 8 | #include 9 | --------------------------------------------------------------------------------