xref: /haiku/src/add-ons/mail_daemon/inbound_protocols/imap/Utilities.cpp (revision a4bdd26d61967231469220573c4b5ee09e29dd49)
1 /*
2  * Copyright 2013, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "Utilities.h"
8 
9 
10 BString
MailboxToFolderName(const BString & mailbox,const BString & separator)11 MailboxToFolderName(const BString& mailbox, const BString& separator)
12 {
13 	if (separator == "/")
14 		return mailbox;
15 
16 	BString name = mailbox;
17 	name.ReplaceAll('/', '_');
18 	name.ReplaceAll(separator.String(), "/");
19 
20 	return name;
21 }
22