1 ///////////////////////////////////////////////////////////////////////////////
2 // Name:        src/os2/stdpaths.cpp
3 // Purpose:     wxStandardPaths implementation for OS/2 systems
4 // Author:      Stefan Neis
5 // Modified by:
6 // Created:     2004-11-06
7 // Copyright:   (c) 2004 Stefan Neis <Stefan.Neis@t-online.de>
8 // Licence:     wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10 
11 // ============================================================================
12 // declarations
13 // ============================================================================
14 
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18 
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21 
22 #if wxUSE_STDPATHS
23 
24 #ifdef __BORLANDC__
25     #pragma hdrstop
26 #endif
27 
28 #ifndef WX_PRECOMP
29     #include "wx/app.h"
30 #endif //WX_PRECOMP
31 
32 #include "wx/filename.h"
33 
34 #include "wx/stdpaths.h"
35 
36 
37 // ============================================================================
38 // wxStandardPaths implementation
39 // ============================================================================
40 
41 // ----------------------------------------------------------------------------
42 // prefix management
43 // ----------------------------------------------------------------------------
44 
45 wxString wxStandardPaths::m_prefix;
46 
SetInstallPrefix(const wxString & prefix)47 void wxStandardPaths::SetInstallPrefix(const wxString& prefix)
48 {
49     m_prefix = prefix;
50 }
51 
GetInstallPrefix() const52 wxString wxStandardPaths::GetInstallPrefix() const
53 {
54     if ( m_prefix.empty() )
55     {
56         wxStandardPaths *self = const_cast<wxStandardPaths *>(this);
57 
58         self->m_prefix = wxT("/usr/local");
59     }
60     return m_prefix;
61 }
62 
63 // ----------------------------------------------------------------------------
64 // public functions
65 // ----------------------------------------------------------------------------
66 
GetConfigDir() const67 wxString wxStandardPaths::GetConfigDir() const
68 {
69     return m_prefix;
70 }
71 
GetUserConfigDir() const72 wxString wxStandardPaths::GetUserConfigDir() const
73 {
74     return wxFileName::GetHomeDir();
75 }
76 
GetDataDir() const77 wxString wxStandardPaths::GetDataDir() const
78 {
79     return GetInstallPrefix() + wxT("\\data");
80 }
81 
GetUserDataDir() const82 wxString wxStandardPaths::GetUserDataDir() const
83 {
84     return AppendAppInfo(wxFileName::GetHomeDir() + wxT("\\."));
85 }
86 
GetPluginsDir() const87 wxString wxStandardPaths::GetPluginsDir() const
88 {
89     return wxString();
90 }
91 
92 #endif // wxUSE_STDPATHS
93