Example #1
0
File: db.cpp Project: ideawu/sdb
Db* Db::open(const std::string &path){
	std::string dir = path;
	if(path[path.size() - 1] != '/'){
		dir = path + "/";
	}
	Db *db = new Db();
	db->_path = dir;
	if(db->init() == -1){
		delete db;
		return NULL;
	}
	return db;
}