Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Add std::string version of the GetAccountDir function
[xestiaab/.git] / source / common / dirs.cpp
index e0e6510..3baf541 100644 (file)
@@ -168,6 +168,57 @@ wxString GetAccountDir(wxString AccName, bool ServerCert)
     
 }
 
+std::string GetAccountDir(std::string AccName, bool ServerCert)
+{
+    
+       // Get the account directory.
+    
+       std::string AccountDir;
+    
+#if defined(__HAIKU__)
+    
+#elif defined(__WIN32__)
+    
+       AccountDir.clear();
+       AccountDir.append(getenv("APPDATA"));
+       AccountDir.append("\\Xestia\\Address Book\\accounts\\");
+       AccountDir.append(AccName);
+       AccountDir.append("\\");
+    
+       if (ServerCert == true){
+               AccountDir.append(wxT("server.crt"));
+       }
+    
+#elif defined(__APPLE__)
+    
+       AccountDir.clear();
+       AccountDir.append(getenv("HOME"));
+       AccountDir.append("/Library/Preferences/Xestia/Address Book/accounts/");
+       AccountDir.append(AccName);
+       AccountDir.append("/");
+    
+       if (ServerCert == true){
+               AccountDir.append("server.crt");
+       }
+    
+#else
+    
+       AccountDir.clear();
+       AccountDir.append(getenv("HOME"));
+       AccountDir.append("/.xestiaab/accounts/");
+       AccountDir.append(AccName);
+       AccountDir.append("/");
+    
+       if (ServerCert == true){
+               AccountDir.append("server.crt");
+       }
+
+#endif
+    
+       return AccountDir;
+    
+}
+
 wxString GetAccountsFile()
 {
     
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy