/// ReadFile.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//--------------------------------------------------------------------------
/// strip 函数在博客“C++:strip函数以及读取ini配置文件”中,这里不再赘述
//--------------------------------------------------------------------------
#include "pch.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
//写入ini文件
void write_INI_File(string file_path, string name, string title, string key, string value)
{
ifstream i(file_path + "\\" + name);
vector<string> lines;
bool match_title = false;
bool match_key = false;
bool match = false;
if (i.is_open())
{
while (!i.eof())
{
string line;
getline(i, line);
//初步清洗
strip(line);
//二次清洗
if (line[0] == ';')
{
C++:更新写入配置ini文件
最新推荐文章于 2024-05-12 01:24:56 发布