728x90 sqlite32 sqlite3 테이블 확인 bool MySqlite::CheckTable(std::string tableName) { sqlite3_stmt* stmt; char query[1024] = ""; std::string tableSql = "SELECT name FROM sqlite_master WHERE name = '%s';"; sprintf(query, tableSql.c_str(), tableName.c_str()); bool result = false; sqlite3_prepare_v2(this->db, query, -1, &stmt, NULL); if (sqlite3_step(stmt) == SQLITE_ROW) { result = true; } sqlite3_reset(stmt); sqlite3_finalize(stmt).. 2021. 4. 12. c++ sqlite ' 포함된 문자열 insert시 쿼리 변환 sqlite ' 포함된 문자열(i'm fine) insert시 에러가 발생함으로 변환 필요 std::string StrConvert::ReplaceAll(std::string& str, const std::string& from, const std::string& to) { size_t start_pos = 0; //string처음부터 검사 while ((start_pos = str.find(from, start_pos)) != std::string::npos) //from을 찾을 수 없을 때까지 { str.replace(start_pos, from.length(), to); start_pos += to.length(); // 중복검사를 피하고 from.length() > to.length()인 경우를 .. 2021. 4. 8. 이전 1 다음 728x90