MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / nativePath

Method nativePath

DAEValidator/library/src/Uri.cpp:114–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 string Uri::nativePath() const
115 {
116 if (!mScheme.empty() && mScheme != "file")
117 return string();
118
119 string currentPath(mPath);
120 string native_path;
121#if _WIN32
122 if (!mAuthority.empty())
123 native_path += string("\\\\") + mAuthority; // UNC path
124
125 // Replace two leading slashes with one leading slash, so that
126 // ///otherComputer/file.dae becomes //otherComputer/file.dae and
127 // //folder/file.dae becomes /folder/file.dae
128 if (currentPath.length() >= 2 && currentPath[0] == '/' && currentPath[1] == '/')
129 currentPath.erase(0, 1);
130
131 // Convert "/C:/" to "C:/"
132 if (currentPath.length() >= 3 && currentPath[0] == '/' && currentPath[2] == ':')
133 currentPath.erase(0, 1);
134
135 // Convert forward slashes to back slashes
136 currentPath = String::Replace(currentPath, "/", "\\");
137#endif
138 native_path += currentPath;
139
140 // Replace % encoded characters
141 return Uri::Decode(native_path);
142 }
143
144 void Uri::clear()
145 {

Callers 3

readFileMethod · 0.80
checkLinksMethod · 0.80
TEST_METHODFunction · 0.80

Calls 4

stringClass · 0.85
lengthMethod · 0.80
eraseMethod · 0.80
emptyMethod · 0.45

Tested by 1

TEST_METHODFunction · 0.64