MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / pathForComponents

Method pathForComponents

src/core/imap/MCIMAPNamespaceItem.cpp:66–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66String * IMAPNamespaceItem::pathForComponents(Array * components)
67{
68 String * path;
69 String * prefix;
70 String * separator;
71
72 components = encodedComponents(components);
73 if (mDelimiter == 0) {
74 separator = MCSTR("");
75 }
76 else {
77 separator = String::stringWithUTF8Format("%c", mDelimiter);
78 }
79 path = components->componentsJoinedByString(separator);
80
81 prefix = mPrefix;
82 if (prefix->length() > 0) {
83 if (!prefix->hasSuffix(String::stringWithUTF8Format("%c", mDelimiter))) {
84 prefix = prefix->stringByAppendingUTF8Format("%c", mDelimiter);
85 }
86 }
87 return prefix->stringByAppendingString(path);
88}
89
90Array * IMAPNamespaceItem::componentsForPath(String * path)
91{

Callers

nothing calls this directly

Calls 6

encodedComponentsFunction · 0.85
hasSuffixMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected