MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / splitConnectionString

Method splitConnectionString

src/jrd/replication/Config.cpp:610–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608// john:smith@server2:/my/replica/database.fdb
609
610void Config::splitConnectionString(const string& input, string& database, string& username, string& password)
611{
612 database = input;
613
614 auto pos = database.rfind('@');
615 if (pos != string::npos)
616 {
617 //john:smith
618 const string temp = database.substr(0, pos);
619 //server2:/my/replica/database.fdb
620 database = database.substr(pos + 1);
621
622 pos = temp.find(':');
623 if (pos != string::npos)
624 {
625 username = temp.substr(0, pos);
626 password = temp.substr(pos + 1);
627 }
628 else
629 {
630 username = temp;
631 }
632 }
633}

Callers

nothing calls this directly

Calls 3

rfindMethod · 0.45
substrMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected