Я хочу создать файл конфигурации.И данные файла конфигурации анализируются для сохранения в LevelDB.
Теперь я выполняю разбор уровня.
Но я не знаю, как подключиться к LevelDB.
Как мне подключить levelDB и сохранить данные ??
Это мой код:
#include <iostream>
#include <algorithm>
#include <fstream>
using namespace std;
int main()
{
ifstream ifs("captin.txt");
while(ifs)
{
std::string str;
std::string id;
// id : "harrypoter"
getline(ifs, str);
str.erase(std::remove(str.begin(),str.end(),' '), str.end());
// id:"harrypoter"
auto Cursor = str.find(':');
// "harrypoter"
id = str.substr(Cursor + 1);
//harrypoter
id.erase(std::remove(id.begin(),id.end(),'\"'), id.end());
cout << id<< endl;
}
}