Quotation marks surrounding string during writing to file with OpenCV FileStorage
My problem are quotation marks during writing to file. The code is
cv::FileStorage fs(outputname.toStdString(), cv::FileStorage::WRITE);
fs << str.c_str();
In file I got "test", but what I want is just test without quotations marks. Can anybody give me a hand?
Actually I found solution, but I'm not sure why it solved problem ?
@outputname.push_back(dir+"/list.xml"); cv::FileStorage fs(outputname.toStdString(), cv::FileStorage::WRITE); fs << "imagelist" << "["; // This doesn't work for me, put quotes // std::string str=imagesList.join(" ").toStdString().c_str(); // I tried that but it doesn't help // str.erase(str.begin(),str.end()-(str.length()-1)); // fs << str.c_str(); // Finally iterator solved problem QStringList::const_iterator constIterator; for (constIterator = imagesList.constBegin(); constIterator != imagesList.constEnd(); ++constIterator) fs << (*constIterator).toLocal8Bit().constData(); fs << "]"; fs.release();@