// Created: 2004-10-19
// RCS-ID: $Id$
// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
-// License: wxWindows license
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// ============================================================================
/* static */
-wxStandardPathsBase& wxStandardPathsBase::Get()
+wxStandardPaths& wxStandardPathsBase::Get()
{
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") );
+ wxCHECK_MSG( traits, gs_stdPaths, wxT("create wxApp before calling this") );
return traits->GetStandardPaths();
}
return filename.GetFullPath();
}
-wxStandardPathsBase& wxAppTraitsBase::GetStandardPaths()
+wxStandardPaths& wxAppTraitsBase::GetStandardPaths()
{
return gs_stdPaths;
}
return wxFileName::GetHomeDir();
}
+wxString wxStandardPathsBase::GetAppDocumentsDir() const
+{
+ const wxString docsDir = GetDocumentsDir();
+ wxString appDocsDir = AppendAppInfo(docsDir);
+
+ return wxDirExists(appDocsDir) ? appDocsDir : docsDir;
+}
+
// return the temporary directory for the current user
wxString wxStandardPathsBase::GetTempDir() const
{
}
/* static */
-wxString wxStandardPathsBase::AppendPathComponent(const wxString& dir, const wxString& component)
+wxString
+wxStandardPathsBase::AppendPathComponent(const wxString& dir,
+ const wxString& component)
{
wxString subdir(dir);
if ( !component.empty() )
{
const wxChar ch = *(subdir.end() - 1);
- if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') )
+ if ( !wxFileName::IsPathSeparator(ch) && ch != wxT('.') )
subdir += wxFileName::GetPathSeparator();
subdir += component;