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"
32 #include "wx/apptrait.h"
34 #include "wx/filename.h"
35 #include "wx/stdpaths.h"
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 static wxStandardPaths gs_stdPaths
;
43 // ============================================================================
45 // ============================================================================
48 wxStandardPathsBase
& wxStandardPathsBase::Get()
50 return wxTheApp
->GetTraits()->GetStandardPaths();
53 wxStandardPathsBase
& wxAppTraitsBase::GetStandardPaths()
58 wxStandardPathsBase::~wxStandardPathsBase()
63 wxString
wxStandardPathsBase::GetLocalDataDir() const
68 wxString
wxStandardPathsBase::GetUserLocalDataDir() const
70 return GetUserDataDir();
74 wxString
wxStandardPathsBase::AppendAppName(const wxString
& dir
)
78 // empty string indicates that an error has occurred, don't touch it then
79 if ( !subdir
.empty() )
81 const wxString appname
= wxTheApp
->GetAppName();
82 if ( !appname
.empty() )
84 const wxChar ch
= *(subdir
.end() - 1);
85 if ( !wxFileName::IsPathSeparator(ch
) && ch
!= _T('.') )
86 subdir
+= wxFileName::GetPathSeparator();
95 #endif // wxUSE_STDPATHS