]> git.saurik.com Git - wxWidgets.git/blob - src/common/stdpbase.cpp
temp compilation fix for wxMac
[wxWidgets.git] / src / common / stdpbase.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/stdpbase.cpp
3 // Purpose: wxStandardPathsBase methods common to all ports
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 2004-10-19
7 // RCS-ID: $Id$
8 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 // License: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 // FIXME: there is no Mac implementation yet
28 #ifndef __WXMAC__
29
30 #ifndef WX_PRECOMP
31 #include "wx/app.h"
32 #endif //WX_PRECOMP
33
34 #include "wx/filename.h"
35 #include "wx/stdpaths.h"
36
37 // ----------------------------------------------------------------------------
38 // module globals
39 // ----------------------------------------------------------------------------
40
41 static wxStandardPaths gs_stdPaths;
42
43 // ============================================================================
44 // implementation
45 // ============================================================================
46
47 /* static */
48 wxStandardPaths& wxStandardPathsBase::Get()
49 {
50 return gs_stdPaths;
51 }
52
53 wxStandardPathsBase::~wxStandardPathsBase()
54 {
55 // nothing to do here
56 }
57
58 wxString wxStandardPathsBase::GetLocalDataDir() const
59 {
60 return GetDataDir();
61 }
62
63 wxString wxStandardPathsBase::GetUserLocalDataDir() const
64 {
65 return GetUserDataDir();
66 }
67
68 /* static */
69 wxString wxStandardPathsBase::AppendAppName(const wxString& dir)
70 {
71 wxString subdir(dir);
72
73 // empty string indicates that an error has occured, don't touch it then
74 if ( !subdir.empty() )
75 {
76 const wxString appname = wxTheApp->GetAppName();
77 if ( !appname.empty() )
78 {
79 const wxChar ch = *(subdir.end() - 1);
80 if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') )
81 subdir += wxFileName::GetPathSeparator();
82
83 subdir += appname;
84 }
85 }
86
87 return subdir;
88 }
89
90 #endif // !__WXMAC__
91