Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Add std::string version of the GetAccountDir function
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 21 Aug 2016 21:56:38 +0000 (22:56 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 21 Aug 2016 21:56:38 +0000 (22:56 +0100)
source/common/dirs.cpp
source/common/dirs.h

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()
 {
     
index 120121d..4731f68 100644 (file)
@@ -25,6 +25,7 @@ wxString GetUserDir();
 wxString GetUserPrefDir();
 wxString GetRecoveryDB();
 wxString GetAccountDir(wxString AccName, bool ServerCert);
+std::string GetAccountDir(std::string AccName, bool ServerCert);
 wxString GetAccountsFile();
 wxString GetSettingsFile();
 
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