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

Method componentsForPath

src/core/imap/MCIMAPNamespaceItem.cpp:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90Array * IMAPNamespaceItem::componentsForPath(String * path)
91{
92 Array * components;
93
94 if (path->hasPrefix(mPrefix)) {
95 path = path->substringFromIndex(mPrefix->length());
96 }
97 if (mDelimiter == 0) {
98 return Array::arrayWithObject(path);
99 }
100 components = path->componentsSeparatedByString(String::stringWithUTF8Format("%c", mDelimiter));
101 components = decodedComponents(components);
102 if (components->count() > 0) {
103 if (((String *) components->objectAtIndex(0))->length() == 0) {
104 components->removeObjectAtIndex(0);
105 }
106 }
107
108 return components;
109}
110
111bool IMAPNamespaceItem::containsFolder(String * folder)
112{

Callers 1

componentsFromPathMethod · 0.45

Calls 8

decodedComponentsFunction · 0.85
hasPrefixMethod · 0.80
substringFromIndexMethod · 0.80
objectAtIndexMethod · 0.80
removeObjectAtIndexMethod · 0.80
lengthMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected