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

Method parse

src/common/config/dir_list.cpp:32–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace Firebird {
31
32void ParsedPath::parse(const PathName& path)
33{
34 clear();
35
36 PathName oldpath = path;
37 int toSkip = 0;
38
39 do
40 {
41 PathName newpath, elem;
42 PathUtils::splitLastComponent(newpath, elem, oldpath);
43 oldpath = newpath;
44
45 if (elem.isEmpty()) // Skip double dir separator
46 continue;
47
48 if (elem == PathUtils::curr_dir_link) // Skip current dir reference
49 continue;
50
51 if (elem == PathUtils::up_dir_link) // skip next up dir
52 {
53 toSkip++;
54 continue;
55 }
56
57 if (toSkip > 0)
58 {
59 toSkip--;
60 continue;
61 }
62
63 insert(0, elem);
64 } while (oldpath.hasData());
65
66 if (toSkip != 0)
67 {
68 // Malformed path, attempt to hack?..
69 // Let it be, consequent comparison will rule it out
70 }
71}
72
73PathName ParsedPath::subPath(FB_SIZE_T n) const
74{

Callers

nothing calls this directly

Calls 4

clearClass · 0.50
insertFunction · 0.50
isEmptyMethod · 0.45
hasDataMethod · 0.45

Tested by

no test coverage detected