MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / to_win32_long_path

Function to_win32_long_path

dds/DCPS/FileSystemStorage.cpp:89–110  ·  view source on GitHub ↗

@returns \\?\

Source from the content-addressed store, hash-verified

87
88/// @returns \\?\<absolute_path>
89ACE_WString to_win32_long_path(const ACE_TCHAR* path)
90{
91 ACE_WString wpath = ACE_TEXT_ALWAYS_WCHAR(path);
92 fwd_slash_to_back_slash(wpath);
93 ACE_WString dir;
94
95 if (is_relative(path)) {
96 DWORD sz = ::GetCurrentDirectoryW(0, 0);
97 ACE_Vector<wchar_t> cur(sz);
98 cur.resize(sz, L'\0');
99 ::GetCurrentDirectoryW(sz, &cur[0]);
100 dir = &cur[0];
101
102 if (dir[dir.length() - 1] != L'\\') dir += L'\\';
103 }
104
105 if (dir.substr(0, 4) != L"\\\\?\\" && wpath.substr(0, 4) != L"\\\\?\\")
106 dir = L"\\\\?\\" + dir;
107
108 dir += wpath;
109 return dir;
110}
111
112int dds_mkdir(const ACE_TCHAR* path)
113{

Callers 5

dds_mkdirFunction · 0.85
dds_chdirFunction · 0.85
is_dirFunction · 0.85
dds_rmdirFunction · 0.85
openMethod · 0.85

Calls 3

fwd_slash_to_back_slashFunction · 0.85
is_relativeFunction · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected