Xmipp  v3.23.11-Nereus
Functions
xmipp_program_sql.cpp File Reference
#include <sstream>
#include "xmipp_program_sql.h"
#include "metadata_label.h"
Include dependency graph for xmipp_program_sql.cpp:

Go to the source code of this file.

Functions

StringescapeSqliteStr (String &str)
 

Function Documentation

◆ escapeSqliteStr()

String& escapeSqliteStr ( String str)

Definition at line 97 of file xmipp_program_sql.cpp.

98 {
99  size_t pos = 0;
100  while ((pos = str.find_first_of("'", pos)) != String::npos)
101  {
102  str.replace(pos, 1, "''");
103  pos += 2;
104  }
105  str = "'" + str + "'";
106  return str;
107 }