当前位置: 首页 > news >正文

C++ —— Tinyxml2在Vs2017下相关使用2(较文1更复杂,附源码)

相关链接

C++ —— Tinyxml2在Vs2017下相关使用1(附源码)

tinyxml2简介

     TinyXML2是一个简单,小巧,高效,C++XML解析器,可以很容易地集成到其他程序中。TinyXML-2解析一个XML文档,并从中构建一个 可以读取、修改和保存的文档对象模型 (DOM)。XML代表“可扩展标记语言”。这是一个通用目的 用于描述任意数据的人类和机器可读标记语言。 为存储应用程序数据而创建的所有随机文件格式都可以 全部替换为 XML。一个解析器可以解决所有问题。

源码下载

     Github - Tinyxml2源码下载地址

     一般来说,下载源码后无需编译仅将其中的tinyxml2.cpp、tinyxml2.h包含在自己的项目中就可以使用了。
     (若需构建库使用CMake构建源码,然后利用Vs仅编译tinyxml2项目。)

使用tinyxml2注意事项

     TinyXML与实体

TinyXML认得预定义的特殊“字符实体”,即:& &< <> >" "&apos; ‘
这些在XML文档读取时都会被辨认出来,并会被转化成等价的UTF-8字符。

代码写入xml
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup Label="ProjectConfigurations"><ProjectConfigurations Include="Debug|X64"><Configuration>Debug</Configuration><Platform>x64</Platform></ProjectConfigurations><ProjectConfiguration Include="Release|X64"><Configuration>Release</Configuration><Platform>x64</Platform></ProjectConfiguration></ItemGroup><Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/><Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/><ImportGroup Condition="Exists(&apos;$(QtMsBuild)\qt_defaults.props&apos;)"><Import Project="$(QtMsBuild)\qt_defaults.props"/></ImportGroup><PropertyGroup Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Debug|x64&apos;" Label="QtSettings"><QtInstall>5.12.4(64)</QtInstall><QtModules>core;gui;widgets;network;</QtModules><QtBuildConfig>debug</QtBuildConfig></PropertyGroup><Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists(&apos;$(QtMsBuild)\qt.targets&apos;) or !Exists(&apos;$(QtMsBuild)\qt.props&apos;)"><Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly."/></Target><ImportGroup Label="ExtensionSettings"/><ImportGroup Label="Shared"/><ImportGroup Label="PropertySheets" Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Debug|x64&apos;"><Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(&apos;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&apos;)" Label="LocalAppDataPlatform"/><Import Project="$(QtMsBuild)\Qt.props"/></ImportGroup><ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos; == &apos;Release|x64&apos;" Label="Configuration"><ClCompile><TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType><MultiProcessorCompilation>true</MultiProcessorCompilation><DebugInformationFormat>None</DebugInformationFormat><Optimization>MaxSpeed</Optimization></ClCompile><Link><SubSystem>Console</SubSystem><GenerateDebugInformation>false</GenerateDebugInformation></Link></ItemDefinitionGroup>
</Project>
#include <iostream>
#include "tinyxml/tinyxml2.h"int main()
{
#if 0 // 写入tinyxml2::XMLDocument xml;xml.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");tinyxml2::XMLElement* rootNode = xml.NewElement("Project");rootNode->SetAttribute("DefaultTargets", "Build");rootNode->SetAttribute("ToolsVersion", "15.0");rootNode->SetAttribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");xml.InsertEndChild(rootNode);{tinyxml2::XMLElement *element_ItemGroup = xml.NewElement("ItemGroup");element_ItemGroup->SetAttribute("Label", "ProjectConfigurations");rootNode->InsertEndChild(element_ItemGroup);{tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfigurations");element_ProjectConfiguration->SetAttribute("Include", "Debug|X64");element_ItemGroup->InsertEndChild(element_ProjectConfiguration);{tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");element_ProjectConfiguration_Configuration->InsertNewText("Debug");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);}{tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");element_ProjectConfiguration_Platform->InsertNewText("x64");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);}}{tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfiguration");element_ProjectConfiguration->SetAttribute("Include", "Release|X64");element_ItemGroup->InsertEndChild(element_ProjectConfiguration);{			tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");element_ProjectConfiguration_Configuration->InsertNewText("Release");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);}{tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");element_ProjectConfiguration_Platform->InsertNewText("x64");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);}}}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");rootNode->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");rootNode->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Condition", "Exists('$(QtMsBuild)\\qt_defaults.props')");{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(QtMsBuild)\\qt_defaults.props");element_ImportGroup->InsertEndChild(element_Import);}rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_PropertyGroup = xml.NewElement("PropertyGroup");element_PropertyGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");element_PropertyGroup->SetAttribute("Label", "QtSettings");{{tinyxml2::XMLElement *element_QtInstall = xml.NewElement("QtInstall");element_QtInstall->InsertNewText("5.12.4(64)");element_PropertyGroup->InsertEndChild(element_QtInstall);}{tinyxml2::XMLElement *element_QtModules = xml.NewElement("QtModules");element_QtModules->InsertNewText("core;gui;widgets;network;");element_PropertyGroup->InsertEndChild(element_QtModules);}{tinyxml2::XMLElement *element_QtBuildConfig = xml.NewElement("QtBuildConfig");element_QtBuildConfig->InsertNewText("debug");element_PropertyGroup->InsertEndChild(element_QtBuildConfig);}}rootNode->InsertEndChild(element_PropertyGroup);}{tinyxml2::XMLElement *element_Target = xml.NewElement("Target");element_Target->SetAttribute("Name", "QtMsBuildNotFound");element_Target->SetAttribute("BeforeTargets", "CustomBuild;ClCompile");element_Target->SetAttribute("Condition", "!Exists('$(QtMsBuild)\\qt.targets') or !Exists('$(QtMsBuild)\\qt.props')");{tinyxml2::XMLElement *element_Message = xml.NewElement("Message");element_Message->SetAttribute("Importance", "High");element_Message->SetAttribute("Text", "QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly.");element_Target->InsertEndChild(element_Message);}rootNode->InsertEndChild(element_Target);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "ExtensionSettings");rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "Shared");rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "PropertySheets");element_ImportGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");rootNode->InsertEndChild(element_ImportGroup);{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props");element_Import->SetAttribute("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')");element_Import->SetAttribute("Label", "LocalAppDataPlatform");element_ImportGroup->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(QtMsBuild)\\Qt.props");element_ImportGroup->InsertEndChild(element_Import);}}{tinyxml2::XMLElement *element_ItemDefinitionGroup = xml.NewElement("ItemDefinitionGroup");element_ItemDefinitionGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Release|x64'");element_ItemDefinitionGroup->SetAttribute("Label", "Configuration");{{tinyxml2::XMLElement *element_ClCompile = xml.NewElement("ClCompile");element_ItemDefinitionGroup->InsertEndChild(element_ClCompile);{tinyxml2::XMLElement *element_TreatWChar_tAsBuiltInType = xml.NewElement("TreatWChar_tAsBuiltInType");element_TreatWChar_tAsBuiltInType->InsertNewText("true");element_ClCompile->InsertEndChild(element_TreatWChar_tAsBuiltInType);}{tinyxml2::XMLElement *element_TreatWChar_MultiProcessorCompilation = xml.NewElement("MultiProcessorCompilation");element_TreatWChar_MultiProcessorCompilation->InsertNewText("true");element_ClCompile->InsertEndChild(element_TreatWChar_MultiProcessorCompilation);}{tinyxml2::XMLElement *element_DebugInformationFormat = xml.NewElement("DebugInformationFormat");element_DebugInformationFormat->InsertNewText("None");element_ClCompile->InsertEndChild(element_DebugInformationFormat);}{tinyxml2::XMLElement *element_Optimization = xml.NewElement("Optimization");element_Optimization->InsertNewText("MaxSpeed");element_ClCompile->InsertEndChild(element_Optimization);}}{tinyxml2::XMLElement *element_Link = xml.NewElement("Link");element_ItemDefinitionGroup->InsertEndChild(element_Link);{tinyxml2::XMLElement *element_SubSystem = xml.NewElement("SubSystem");element_SubSystem->InsertNewText("Console");element_Link->InsertEndChild(element_SubSystem);}{tinyxml2::XMLElement *element_GenerateDebugInformation = xml.NewElement("GenerateDebugInformation");element_GenerateDebugInformation->InsertNewText("false");element_Link->InsertEndChild(element_GenerateDebugInformation);}}}rootNode->InsertEndChild(element_ItemDefinitionGroup);}xml.SaveFile("./temp_behaviac.xml");xml.Clear();system("pause");return 0;
}

代码读取xml

在这里插入图片描述

int main()
{tinyxml2::XMLDocument xml;tinyxml2::XMLError errXml = xml.LoadFile("./temp_behaviac.xml");if (tinyxml2::XML_SUCCESS == errXml){tinyxml2::XMLElement* root = xml.RootElement();if (root){std::cout << root->Value()<< " DefaultTargets=" << root->Attribute("DefaultTargets")<< " ToolsVersion=" << root->Attribute("ToolsVersion")<< " xmlns=" << root->Attribute("xmlns") << std::endl;tinyxml2::XMLElement *XMLElement_ItemGroup = root->FirstChildElement();if (XMLElement_ItemGroup){std::cout << "\t" << XMLElement_ItemGroup->Value() << " Label=" << XMLElement_ItemGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_ProjectConfigurations = XMLElement_ItemGroup->FirstChildElement();if (!XMLElement_ProjectConfigurations) { return -1; }std::cout << "\t\t" << XMLElement_ProjectConfigurations->Value() << " Include=" << XMLElement_ProjectConfigurations->Attribute("Include") << std::endl;{tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfigurations->FirstChildElement();if (!XMLElement_Configuration) { return -1; }std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();if (!XMLElement_Platform) { return -1; }std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_ProjectConfiguration = XMLElement_ProjectConfigurations->NextSiblingElement();if (!XMLElement_ProjectConfiguration) { return -1; }std::cout << "\t\t" << XMLElement_ProjectConfiguration->Value() << " Include=" << XMLElement_ProjectConfiguration->Attribute("Include") << std::endl;{tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfiguration->FirstChildElement();if (!XMLElement_Configuration) { return -1; }std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();if (!XMLElement_Platform) { return -1; }std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;}}tinyxml2::XMLElement *XMLElement_Import = XMLElement_ItemGroup->NextSiblingElement();if (!XMLElement_Import) { return -1; }std::cout << "\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();if (!XMLElement_Import2) { return -1; }std::cout << "\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup = XMLElement_Import2->NextSiblingElement();if (!XMLElement_ImportGroup) { return -1; }std::cout << "\t" << XMLElement_ImportGroup->Value() << " Condition=" << XMLElement_ImportGroup->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup->FirstChildElement();if (!XMLElement_Import) { return -1; }std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;}tinyxml2::XMLElement *XMLElement_PropertyGroup = XMLElement_ImportGroup->NextSiblingElement();if (!XMLElement_PropertyGroup) { return -1; }std::cout << "\t" << XMLElement_PropertyGroup->Value() << " Condition=" << XMLElement_PropertyGroup->Attribute("Condition") << " Label=" << XMLElement_PropertyGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_QtInstall = XMLElement_PropertyGroup->FirstChildElement();if (!XMLElement_QtInstall) { return -1; }std::cout << "\t\t" << XMLElement_QtInstall->Value() << " " << XMLElement_QtInstall->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_QtModules = XMLElement_QtInstall->NextSiblingElement();if (!XMLElement_QtModules) { return -1; }std::cout << "\t\t" << XMLElement_QtModules->Value() << " " << XMLElement_QtModules->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_QtBuildConfig = XMLElement_QtModules->NextSiblingElement();if (!XMLElement_QtBuildConfig) { return -1; }std::cout << "\t\t" << XMLElement_QtBuildConfig->Value() << " " << XMLElement_QtBuildConfig->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_Target = XMLElement_PropertyGroup->NextSiblingElement();if (!XMLElement_Target) { return -1; }std::cout << "\t" << XMLElement_Target->Value() << " Name=" << XMLElement_Target->Attribute("Name") << " BeforeTargets=" << XMLElement_Target->Attribute("BeforeTargets") << " Condition=" << XMLElement_Target->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Message = XMLElement_Target->FirstChildElement();if (!XMLElement_Message) { return -1; }std::cout << "\t\t" << XMLElement_Message->Value() << " Importance=" << XMLElement_Message->Attribute("Importance") << " Text=" << XMLElement_Message->Attribute("Text") << std::endl;}tinyxml2::XMLElement *XMLElement_ImportGroup1 = XMLElement_Target->NextSiblingElement();if (!XMLElement_ImportGroup1) { return -1; }std::cout << "\t" << XMLElement_ImportGroup1->Value() << " Label=" << XMLElement_ImportGroup1->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup2 = XMLElement_ImportGroup1->NextSiblingElement();if (!XMLElement_ImportGroup2) { return -1; }std::cout << "\t" << XMLElement_ImportGroup2->Value() << " Label=" << XMLElement_ImportGroup2->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup3 = XMLElement_ImportGroup2->NextSiblingElement();if (!XMLElement_ImportGroup3) { return -1; }std::cout << "\t" << XMLElement_ImportGroup3->Value() << " Label=" << XMLElement_ImportGroup3->Attribute("Label") << " Condition=" << XMLElement_ImportGroup3->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup3->FirstChildElement();if (!XMLElement_Import) { return -1; }std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << " Condition=" << XMLElement_Import->Attribute("Condition") << " Label=" << XMLElement_Import->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();if (!XMLElement_Import2) { return -1; }std::cout << "\t\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;}tinyxml2::XMLElement *XMLElement_ItemDefinitionGroup = XMLElement_ImportGroup3->NextSiblingElement();if (!XMLElement_ItemDefinitionGroup) { return -1; }std::cout << "\t" << XMLElement_ItemDefinitionGroup->Value() << " Condition=" << XMLElement_ItemDefinitionGroup->Attribute("Condition") << " Label=" << XMLElement_ItemDefinitionGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_ClCompile = XMLElement_ItemDefinitionGroup->FirstChildElement();if (!XMLElement_ClCompile) { return -1; }std::cout << "\t" << XMLElement_ClCompile->Value() << std::endl;{tinyxml2::XMLElement *XMLElement_TreatWChar_tAsBuiltInType = XMLElement_ClCompile->FirstChildElement();if (!XMLElement_TreatWChar_tAsBuiltInType) { return -1; }std::cout << "\t\t" << XMLElement_TreatWChar_tAsBuiltInType->Value() << " " << XMLElement_TreatWChar_tAsBuiltInType->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_MultiProcessorCompilation = XMLElement_TreatWChar_tAsBuiltInType->NextSiblingElement();if (!XMLElement_MultiProcessorCompilation) { return -1; }std::cout << "\t\t" << XMLElement_MultiProcessorCompilation->Value() << " " << XMLElement_MultiProcessorCompilation->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_DebugInformationFormat = XMLElement_MultiProcessorCompilation->NextSiblingElement();if (!XMLElement_DebugInformationFormat) { return -1; }std::cout << "\t\t" << XMLElement_DebugInformationFormat->Value() << " " << XMLElement_DebugInformationFormat->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Optimization = XMLElement_DebugInformationFormat->NextSiblingElement();if (!XMLElement_Optimization) { return -1; }std::cout << "\t\t" << XMLElement_Optimization->Value() << " " << XMLElement_Optimization->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_Link = XMLElement_ClCompile->NextSiblingElement();if (!XMLElement_Link) { return -1; }std::cout << "\t" << XMLElement_Link->Value() << std::endl;{tinyxml2::XMLElement *XMLElement_SubSystem = XMLElement_Link->FirstChildElement();if (!XMLElement_SubSystem) { return -1; }std::cout << "\t\t" << XMLElement_SubSystem->Value() << " " << XMLElement_SubSystem->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_GenerateDebugInformation = XMLElement_SubSystem->NextSiblingElement();if (!XMLElement_GenerateDebugInformation) { return -1; }std::cout << "\t\t" << XMLElement_GenerateDebugInformation->Value() << " " << XMLElement_GenerateDebugInformation->GetText() << std::endl;}}}}root = nullptr;}system("pause");return 0;
}

笔者

笔者 - jxd

相关文章:

C++ —— Tinyxml2在Vs2017下相关使用2(较文1更复杂,附源码)

相关链接 C —— Tinyxml2在Vs2017下相关使用1&#xff08;附源码&#xff09; tinyxml2简介 TinyXML2是一个简单&#xff0c;小巧&#xff0c;高效&#xff0c;CXML解析器&#xff0c;可以很容易地集成到其他程序中。TinyXML-2解析一个XML文档&#xff0c;并从中构建一个 可以…...

阿里内推强推的并发编程学习笔记,原理+实战+面试题,面面俱到!

并发编程 谈到并发编程&#xff0c;可能很多人都有过经验&#xff0c;甚至比我了解的更多。 那么并发与并行的区别又是什么&#xff1f; 并发编程是编程中的核心问题&#xff0c;实践中&#xff0c;当人们希望利用计算机处理一些现实世界问题&#xff0c;以及希望同时处理多…...

域名注册查询流程

域名注册查询怎么查域名是否被注册?域名注册查询如何查域名的过期时间和注册商?域名注册查询用什么工具?下面是关于域名注册查询流程介绍。 1、域名注册查询可以用什么工具? 这里可以使用聚查工具&#xff0c;聚查包括&#xff1a;whois 查询、建站历史查询、反链查询、P…...

【Linux学习笔记】代码编辑工具vim

1. vim工具基本模式的转换2. vim命令模式下的各种编辑命令2.1. 光标行定位2.2. 光标自由定位2.3. 复制粘贴2.4. 删除2.5. 文本的大小写替换2.6. 文本的替换2.7. 文本的前删后删2.8. 撤销操作 3. vim底行模式下的命令3.1. 设置行号与取消设置行号3.2. 分屏操作3.3. 在不退出vim的…...

Android Boring SSL

前期设置 SSLContext.getInstance(“TLS”)SSLContext.init()SSLContext.getSocketFactory()SSLSocketFactory.createSocket()NativeSsl.newInstance()BioWrapper 的创建ConscryptEngineSocket.startHandshake() TLS协商 state_start_connect(TLS)state_enter_early_data(TLS)s…...

中国人民大学与加拿大女王大学金融硕士项目:开启你的金融精英之路

在全球化的今天&#xff0c;金融行业的发展日新月异&#xff0c;对金融人才的需求也日益增长。为了满足这一需求&#xff0c;中国人民大学与加拿大女王大学联合推出了金融硕士项目&#xff0c;旨在培养具有国际视野、专业素养和创新能力的金融精英。 这一开创性的项目将两大世…...

HashSet编程小案例,控制生日和姓名。重写HashCode

Java编程&#xff1a; 定义员工Employee类&#xff0c;该类包含&#xff1a;private成员属性name&#xff0c;sal&#xff0c;birthday(MyDate类型)&#xff0c; 其中birthday为MyDate类型(属性包括&#xff1a;year&#xff0c;month&#xff0c;day)&#xff0c; 要求&…...

虚幻阴影整理

虚拟阴影贴图&#xff08;VSM&#xff09;是一种全新的阴影贴图方法&#xff0c;可以提供稳定的高分辨率阴影。通过与虚幻引擎5的Nanite虚拟几何体、Lumen全局光照和反射以及世界分区功能结合使用&#xff0c;它能够实现电影级的品质效果&#xff0c;为大型开放场景提供光照。 …...

MySQL数据库(一)

数据库 —— 基础 1. 数据库 DataBase 数据库管理系统 2. SQL语言2.1 DDL数据定义语言2.1.1 数据库基础操作2.1.2 数据表基础操作2.1.3 字段基础操作 2.2 DML表记录管理2.2.1 插入数据INSERT2.2.2 更新数据UPDATE2.2.3 删除数据DELETE 3. SQL数据类型3.1 数值类型3.1.1 整数类型…...

C++11 新特性

C11 新特性 C11 新特性统一的列表初始化声明auto 关键字decltype 关键字nullptr 关键字 关键字 using使用 using 在子类中引用基类的成员使用 using 关键字定义类型别名 范围-based for 循环右值引用和移动语义左值引用和右值引用右值引用使用场景和意义完美转发 lambda表达式移…...

排查手机应用app微信登录问题不跳转失败原因汇总及其解决方案

经过最近我发的文章,我个人觉得解决了不少小问题,因为最近很小白的问题已经没有人私聊问我了,我总结了一下排查手机应用app微信登录问题不跳转失败的原因汇总及其解决方案在这篇文章中,分析微信登录不跳转的原因,并提供解决方案。希望通过这篇文章,能够帮助大家顺利解决这…...

软考高级系统架构设计师系列之:数学与经济管理

软考高级系统架构设计师系列之:数学与经济管理 一、数学与经济管理二、图论应用-最小生成树三、图论应用-最短路径四、图论应用-网络与最大流量五、运筹方法-线性规划六、运筹方法-动态规划七、运筹方法-转移矩阵八、运筹方法-排队论九、运筹方法-决策-不确定决策十、运筹方法…...

基于Scrapyd与Gerapy部署scrapy爬虫方案【可用于分布式爬虫部署】

scrapyd部署爬虫 Scrapyd 是一个基于 Scrapy 的开源项目&#xff0c;它提供了一个简单的方式来部署、运行和监控 Scrapy 爬虫。它是一个用于集成 Scrapy 爬虫到分布式架构中的工具&#xff0c;允许您在分布式环境中运行爬虫&#xff0c;并提供了一组 Web API&#xff0c;用于管…...

ST-SSL:基于自监督学习的交通流预测模型

文章信息 文章题为“Spatio-Temporal Self-Supervised Learning for Traffic Flow Prediction”&#xff0c;是一篇发表于The Thirty-Seventh AAAI Conference on Artificial Intelligence (AAAI-23)的一篇论文。该论文主要针对交通流预测任务&#xff0c;结合自监督学习&#…...

如何处理C++中的字符串编码和国际化?

在C中处理字符串编码和国际化的常用方式如下&#xff1a; 字符串编码&#xff1a; 使用UTF-8编码&#xff1a;UTF-8是一种可变字节长度的编码方式&#xff0c;广泛用于表示 Unicode 字符。C中的字符串类型std::string默认使用的是UTF-8编码。可以通过使用宽字符类型std::wstrin…...

DH48WK 温控器参数设置

北京东昊力伟科技有限责任公司 温控仪、温度控制器 产品特点&#xff1a; 可外接温度传感器Pt100、Cu50、K、E、J、N、T、R、S、B兼容输入&#xff1b;PID控制输出、位式控制输出、继电器报警输出&#xff1b;控温能满足设定温度值的0.2℃&#xff1b;既可用于加热控制、也可…...

【文档智能】多模态预训练模型及相关数据集汇总

前言 大模型时代&#xff0c;在现实场景中或者企业私域数据中&#xff0c;大多数数据都以文档的形式存在&#xff0c;如何更好的解析获取文档数据显得尤为重要。文档智能也从以前的目标检测&#xff08;版面分析&#xff09;阶段转向多模态预训练阶段&#xff0c;本文将介绍目…...

超全整理,性能测试——数据库索引问题定位+分析(详细)

目录&#xff1a;导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结&#xff08;尾部小惊喜&#xff09; 前言 1、数据库服务器添…...

44springboot摄影跟拍预定管理系统

大家好✌&#xff01;我是CZ淡陌。一名专注以理论为基础实战为主的技术博主&#xff0c;将再这里为大家分享优质的实战项目&#xff0c;本人在Java毕业设计领域有多年的经验&#xff0c;陆续会更新更多优质的Java实战项目&#xff0c;希望你能有所收获&#xff0c;少走一些弯路…...

Flink之窗口触发机制及自定义Trigger的使用

1 窗口触发机制 窗口计算的触发机制都是由Trigger类决定的,Flink中为各类内置的WindowsAssigner都设计了对应的默认Trigger. 层次结构如下: Trigger ProcessingTimeoutTriggerEventTimeTriggerCountTriggerDeltaTriggerNeverTrigger in GlobalWindowsContinuousEventTimeTrigge…...

基于uniapp+WebSocket实现聊天对话、消息监听、消息推送、聊天室等功能,多端兼容

基于 ​UniApp + WebSocket​实现多端兼容的实时通讯系统,涵盖WebSocket连接建立、消息收发机制、多端兼容性配置、消息实时监听等功能,适配​微信小程序、H5、Android、iOS等终端 目录 技术选型分析WebSocket协议优势UniApp跨平台特性WebSocket 基础实现连接管理消息收发连接…...

聊一聊接口测试的意义有哪些?

目录 一、隔离性 & 早期测试 二、保障系统集成质量 三、验证业务逻辑的核心层 四、提升测试效率与覆盖度 五、系统稳定性的守护者 六、驱动团队协作与契约管理 七、性能与扩展性的前置评估 八、持续交付的核心支撑 接口测试的意义可以从四个维度展开&#xff0c;首…...

ip子接口配置及删除

配置永久生效的子接口&#xff0c;2个IP 都可以登录你这一台服务器。重启不失效。 永久的 [应用] vi /etc/sysconfig/network-scripts/ifcfg-eth0修改文件内内容 TYPE"Ethernet" BOOTPROTO"none" NAME"eth0" DEVICE"eth0" ONBOOT&q…...

蓝桥杯 冶炼金属

原题目链接 &#x1f527; 冶炼金属转换率推测题解 &#x1f4dc; 原题描述 小蓝有一个神奇的炉子用于将普通金属 O O O 冶炼成为一种特殊金属 X X X。这个炉子有一个属性叫转换率 V V V&#xff0c;是一个正整数&#xff0c;表示每 V V V 个普通金属 O O O 可以冶炼出 …...

4. TypeScript 类型推断与类型组合

一、类型推断 (一) 什么是类型推断 TypeScript 的类型推断会根据变量、函数返回值、对象和数组的赋值和使用方式&#xff0c;自动确定它们的类型。 这一特性减少了显式类型注解的需要&#xff0c;在保持类型安全的同时简化了代码。通过分析上下文和初始值&#xff0c;TypeSc…...

vue3 daterange正则踩坑

<el-form-item label"空置时间" prop"vacantTime"> <el-date-picker v-model"form.vacantTime" type"daterange" start-placeholder"开始日期" end-placeholder"结束日期" clearable :editable"fal…...

SpringAI实战:ChatModel智能对话全解

一、引言&#xff1a;Spring AI 与 Chat Model 的核心价值 &#x1f680; 在 Java 生态中集成大模型能力&#xff0c;Spring AI 提供了高效的解决方案 &#x1f916;。其中 Chat Model 作为核心交互组件&#xff0c;通过标准化接口简化了与大语言模型&#xff08;LLM&#xff0…...

沙箱虚拟化技术虚拟机容器之间的关系详解

问题 沙箱、虚拟化、容器三者分开一一介绍的话我知道他们各自都是什么东西&#xff0c;但是如果把三者放在一起&#xff0c;它们之间到底什么关系&#xff1f;又有什么联系呢&#xff1f;我不是很明白&#xff01;&#xff01;&#xff01; 就比如说&#xff1a; 沙箱&#…...

若依登录用户名和密码加密

/*** 获取公钥&#xff1a;前端用来密码加密* return*/GetMapping("/getPublicKey")public RSAUtil.RSAKeyPair getPublicKey() {return RSAUtil.rsaKeyPair();}新建RSAUti.Java package com.ruoyi.common.utils;import org.apache.commons.codec.binary.Base64; im…...

负载均衡器》》LVS、Nginx、HAproxy 区别

虚拟主机 先4&#xff0c;后7...