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

Function share_name_from_unc

src/common/isc_file.cpp:1578–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1576
1577
1578static void share_name_from_unc(tstring& file_name, LPREMOTE_NAME_INFO unc_remote)
1579{
1580/**************************************
1581 *
1582 * s h a r e _ n a m e _ f r o m _ u n c
1583 *
1584 **************************************
1585 *
1586 * Functional description
1587 * Extract the share name from a REMOTE_NAME_INFO struct
1588 * returned by WNetGetUniversalName. It uses only the
1589 * lpConnectionName element of the structure. It converts
1590 * "\\node\sharepoint" to "\\node\!sharepoint!" and appends
1591 * the rest of file_name after the drive into expanded_name.
1592 *
1593 **************************************/
1594 tstring expanded_name = unc_remote->lpConnectionName;
1595
1596 // bracket the share name with "!" characters
1597 size p = expanded_name.find('\\', 2);
1598 expanded_name.insert(++p, 1, '!');
1599 p = expanded_name.find('\\', p + 1);
1600 if (p != npos)
1601 {
1602 expanded_name.erase(p, npos);
1603 }
1604 expanded_name += '!';
1605
1606 // add rest of file name
1607 file_name.replace(0, 2, expanded_name);
1608}
1609#endif // WIN_NT
1610
1611#ifdef HAVE_ICONV_H

Callers 1

ISC_expand_shareFunction · 0.85

Calls 3

findMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected