4
#include <wx/filename.h>
8
#if !wxCHECK_VERSION( 3, 0, 0 )
10
// implement missing wx2.8 function until >= wx3.0 pervades.
11
static wxString wxJoin(const wxArrayString& arr, const wxChar sep,
12
const wxChar escape = '\\')
14
size_t count = arr.size();
20
// pre-allocate memory using the estimation of the average length of the
21
// strings in the given array: this is very imprecise, of course, but
22
// better than nothing
23
str.reserve(count*(arr[0].length() + arr[count-1].length()) / 2);
25
if ( escape == wxT('\0') )
27
// escaping is disabled:
28
for ( size_t i = 0; i < count; i++ )
35
else // use escape character
37
for ( size_t n = 0; n < count; n++ )
42
for ( wxString::const_iterator i = arr[n].begin(),
49
str += escape; // escape this separator
55
str.Shrink(); // release extra memory if we allocated too much
61
/// Put aPriorityPath in front of all paths in the value of aEnvVar.
62
const wxString PrePendPath( const wxString& aEnvVar, const wxString& aPriorityPath )
66
paths.AddEnvList( aEnvVar );
67
paths.Insert( aPriorityPath, 0 );
69
return wxJoin( paths, wxPATH_SEP[0] );