The **inicpp** project will help you **easily** to do this work.The best ini file parse library for Modern C++.
**Description:** The **INI header-only library** for **Modern C++** supports **reading**, **writing**, and even **commenting**. It is easy to use and simplifies working with **INI** files.
**Project:** [https://github.com/dujingning/inicpp][1]
**Usage:**
**Read:** Load file to memory, used directly by the user.
#include "inicpp.hpp"
#include <iostream>
int main()
{
inicpp::IniManager _ini("config.ini"); // Load and parse the INI file.
std::cout << _ini["rtsp"]["port"] << std::endl;
}
**Write:** Modify directly to the file.
#include "inicpp.hpp"
#include <iostream>
int main()
{
inicpp::IniManager _ini("config.ini"); // Load and parse the INI file.
_ini.modify("rtsp","port","554");
std::cout << _ini["rtsp"]["port"] << std::endl;
}
**details form github:**
[https://github.com/dujingning/inicpp][1]
[1]: https://github.com/dujingning/inicpp
The **inicpp** project will help you **easily** to do this work.The best ini file parse library for Modern C++.
**Description:** The **INI header-only library** for **Modern C++** supports **reading**, **writing**, and even **commenting**. It is easy to use and simplifies working with **INI** files.
**Project:** [https://github.com/dujingning/inicpp][1]
**Usage:**
**Read:** Load file to memory, used directly by the user.
#include "inicpp.hpp"
#include <iostream>
int main()
{
inicpp::IniManager _ini("config.ini"); // Load and parse the INI file.
std::cout << _ini["rtsp"]["port"] << std::endl;
}
**Write:** Modify directly to the file.
#include "inicpp.hpp"
#include <iostream>
int main()
{
inicpp::IniManager _ini("config.ini"); // Load and parse the INI file.
_ini.modify("rtsp","port","554");
std::cout << _ini["rtsp"]["port"] << std::endl;
}
**details form github:**
[https://github.com/dujingning/inicpp][1]
[1]: https://github.com/dujingning/inicpp