MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / EncodePath

Method EncodePath

src/providers/onedrive.cpp:56–74  ·  view source on GitHub ↗

URL-encode each path segment but preserve '/' separators

Source from the content-addressed store, hash-verified

54
55// URL-encode each path segment but preserve '/' separators
56std::string OneDriveProvider::EncodePath(const std::string& path) {
57 std::string out;
58 size_t start = 0;
59 while (start < path.size()) {
60 size_t slash = path.find('/', start);
61 std::string seg = (slash != std::string::npos)
62 ? path.substr(start, slash - start)
63 : path.substr(start);
64 if (!seg.empty())
65 out += UrlEncode(seg);
66 if (slash != std::string::npos) {
67 out += '/';
68 start = slash + 1;
69 } else {
70 break;
71 }
72 }
73 return out;
74}
75
76// /me/drive/root:/CloudRedirect/{acct}/{app}/{filename}:
77std::string OneDriveProvider::BuildItemPath(uint32_t accountId, uint32_t appId,

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
findMethod · 0.80
UrlEncodeFunction · 0.50

Tested by

no test coverage detected