1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/stdpbase.cpp
3 // Purpose: wxStandardPathsBase methods common to all ports
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 // License: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
30 #include "wx/apptrait.h"
32 #include "wx/filename.h"
33 #include "wx/stdpaths.h"
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
39 static wxStandardPaths gs_stdPaths
;
41 // ============================================================================
43 // ============================================================================
46 wxStandardPathsBase
& wxStandardPathsBase::Get()
48 return wxTheApp
->GetTraits()->GetStandardPaths();
51 wxStandardPathsBase
& wxAppTraitsBase::GetStandardPaths()
56 wxStandardPathsBase::~wxStandardPathsBase()
61 wxString
wxStandardPathsBase::GetLocalDataDir() const
66 wxString
wxStandardPathsBase::GetUserLocalDataDir() const
68 return GetUserDataDir();
72 wxString
wxStandardPathsBase::AppendAppName(const wxString
& dir
)
76 // empty string indicates that an error has occured, don't touch it then
77 if ( !subdir
.empty() )
79 const wxString appname
= wxTheApp
->GetAppName();
80 if ( !appname
.empty() )
82 const wxChar ch
= *(subdir
.end() - 1);
83 if ( !wxFileName::IsPathSeparator(ch
) && ch
!= _T('.') )
84 subdir
+= wxFileName::GetPathSeparator();