MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / MakePostgresString

Function MakePostgresString

sourcecommon/utils.cpp:1409–1433  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1407}
1408//---------------------------------------------------------------------------
1409AnsiString __fastcall MakePostgresString(AnsiString source, int maxlen)
1410{
1411 try
1412 {
1413 for(int i=1,l=source.Length(); i<=l; i++)
1414 {
1415 if( source[i]=='\'' )
1416 {
1417 source.Insert('\'', i++);
1418 l++;
1419 }
1420 else if( source[i]=='\\' )
1421 {
1422 source.Insert('\\', i++);
1423 l++;
1424 }
1425 }
1426 }
1427 catch(...)
1428 {}
1429 if( maxlen>0 )
1430 if( source.Length() > maxlen )
1431 source.SetLength(maxlen);
1432 return AnsiString('\'') + source + '\'';
1433}
1434//---------------------------------------------------------------------------
1435bool __fastcall WaitService(char * szServiceName, DWORD dwCurrentState, DWORD to)
1436{

Callers

nothing calls this directly

Calls 1

InsertMethod · 0.80

Tested by

no test coverage detected