3104 |
return result.Produce(); |
return result.Produce(); |
3105 |
} |
} |
3106 |
|
|
3107 |
|
String LSCPServer::SetDbInstrumentFilePath(String OldPath, String NewPath) { |
3108 |
|
dmsg(2,("LSCPServer: SetDbInstrumentFilePath(OldPath=%s,NewPath=%s)\n", OldPath.c_str(), NewPath.c_str())); |
3109 |
|
LSCPResultSet result; |
3110 |
|
#if HAVE_SQLITE3 |
3111 |
|
try { |
3112 |
|
InstrumentsDb::GetInstrumentsDb()->SetInstrumentFilePath(OldPath, NewPath); |
3113 |
|
} catch (Exception e) { |
3114 |
|
result.Error(e); |
3115 |
|
} |
3116 |
|
#else |
3117 |
|
result.Error(String(DOESNT_HAVE_SQLITE3), 0); |
3118 |
|
#endif |
3119 |
|
return result.Produce(); |
3120 |
|
} |
3121 |
|
|
3122 |
|
String LSCPServer::FindLostDbInstrumentFiles() { |
3123 |
|
dmsg(2,("LSCPServer: FindLostDbInstrumentFiles()\n")); |
3124 |
|
LSCPResultSet result; |
3125 |
|
#if HAVE_SQLITE3 |
3126 |
|
try { |
3127 |
|
String list; |
3128 |
|
StringListPtr pLostFiles = InstrumentsDb::GetInstrumentsDb()->FindLostInstrumentFiles(); |
3129 |
|
|
3130 |
|
for (int i = 0; i < pLostFiles->size(); i++) { |
3131 |
|
if (list != "") list += ","; |
3132 |
|
list += "'" + pLostFiles->at(i) + "'"; |
3133 |
|
} |
3134 |
|
|
3135 |
|
result.Add(list); |
3136 |
|
} catch (Exception e) { |
3137 |
|
result.Error(e); |
3138 |
|
} |
3139 |
|
#else |
3140 |
|
result.Error(String(DOESNT_HAVE_SQLITE3), 0); |
3141 |
|
#endif |
3142 |
|
return result.Produce(); |
3143 |
|
} |
3144 |
|
|
3145 |
String LSCPServer::FindDbInstrumentDirectories(String Dir, std::map<String,String> Parameters, bool Recursive) { |
String LSCPServer::FindDbInstrumentDirectories(String Dir, std::map<String,String> Parameters, bool Recursive) { |
3146 |
dmsg(2,("LSCPServer: FindDbInstrumentDirectories(Dir=%s)\n", Dir.c_str())); |
dmsg(2,("LSCPServer: FindDbInstrumentDirectories(Dir=%s)\n", Dir.c_str())); |
3147 |
LSCPResultSet result; |
LSCPResultSet result; |