+// ----------------------------------------------------------------------------
+// generic functions in terms of which the other ones are implemented
+// ----------------------------------------------------------------------------
+
+static wxString BundleRelativeURLToPath(CFURLRef relativeURL)
+{
+ CFURLRef absoluteURL = CFURLCopyAbsoluteURL(relativeURL);
+ wxCHECK_MSG(absoluteURL, wxEmptyString, wxT("Failed to resolve relative URL to absolute URL"));
+ CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kDefaultPathStyle);
+ CFRelease(absoluteURL);
+ return wxMacCFStringHolder(cfStrPath).AsString(wxLocale::GetSystemEncoding());
+}
+
+wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const
+{
+ wxCHECK_MSG(m_bundle, wxEmptyString,
+ wxT("wxStandardPaths for CoreFoundation only works with bundled apps"));
+ CFURLRef relativeURL = (*func)(m_bundle);
+ wxCHECK_MSG(relativeURL, wxEmptyString, wxT("Couldn't get URL"));
+ wxString ret(BundleRelativeURLToPath(relativeURL));
+ CFRelease(relativeURL);
+ return ret;
+}
+
+wxString wxStandardPathsCF::GetDocumentsDir() const
+{
+#ifdef __WXMAC__
+ return wxMacFindFolderNoSeparator
+ (
+#if TARGET_API_MAC_OSX
+ kUserDomain,
+#else
+ kOnSystemDisk,
+#endif
+ kDocumentsFolderType,
+ kCreateFolder
+ );
+#else
+ return wxFileName::GetHomeDir() + wxT("/Documents");
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// wxStandardPathsCF public API
+// ----------------------------------------------------------------------------
+
+wxString wxStandardPathsCF::GetConfigDir() const