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

Function ISC_analyze_pclan

src/common/isc_file.cpp:350–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348
349#if defined(WIN_NT)
350bool ISC_analyze_pclan(tstring& expanded_name, tstring& node_name)
351{
352/**************************************
353 *
354 * I S C _ a n a l y z e _ p c l a n
355 *
356 **************************************
357 *
358 * Functional description
359 * Check a file name for a SMB mount point. If so,
360 * decompose into node name and remote file name.
361 *
362 **************************************/
363 ISC_expand_share(expanded_name);
364
365 if (expanded_name.length() < 2 ||
366 (expanded_name[0] != '\\' && expanded_name[0] != '/') ||
367 (expanded_name[1] != '\\' && expanded_name[1] != '/'))
368 {
369 return false;
370 }
371
372 const size p = expanded_name.find_first_of("\\/", 2);
373 if (p == npos)
374 return false;
375
376 if (Config::getRemoteFileOpenAbility())
377 {
378 if (expanded_name.find(':', p + 1) == npos)
379 return false;
380 }
381
382 node_name = expanded_name.substr(2, p - 2);
383 expanded_name.erase(0, p + 1);
384
385 return true;
386}
387#endif
388
389

Callers 2

analyzeFunction · 0.85
ISC_extract_hostFunction · 0.85

Calls 6

ISC_expand_shareFunction · 0.85
lengthMethod · 0.45
find_first_ofMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected