MCPcopy Create free account
hub / github.com/LUX-Core/lux / WriteConfigToFile

Function WriteConfigToFile

src/util.cpp:627–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void WriteConfigToFile(std::string strKey, std::string strValue)
628{
629 std::ifstream fin(GetConfigFile().string().c_str());
630 std::string line;
631 std::stringstream ss;
632 ss << strKey << "=" << strValue << endl;
633 while (std::getline(fin, line)) {
634 if(line.length() > 0 && line.find(strKey) == std::string::npos) {
635 ss << line << endl;
636 }
637 }
638 fin.close();
639 std::ofstream fout(GetConfigFile().string().c_str());
640 fout << ss.str() << endl;
641 fout.close();
642 ss.clear();
643}
644#ifndef WIN32
645boost::filesystem::path GetPidFile()
646{

Callers 1

setDataMethod · 0.85

Calls 6

GetConfigFileFunction · 0.85
strMethod · 0.80
lengthMethod · 0.45
findMethod · 0.45
closeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected