a more easy to use version of wxGetHomeDir() added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-12-09 15:14:58 +00:00
parent 178009938b
commit c51deffc32
3 changed files with 28 additions and 5 deletions

View File

@@ -1284,11 +1284,15 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa
<wx/utils.h> <wx/utils.h>
\membersection{::wxGetHomeDir} \membersection{::wxGetHomeDir}\label{wxgethomedir}
\func{wxString}{wxGetHomeDir}{\param{const wxString\& }{buf}} \func{wxString}{wxGetHomeDir}{\void}
Fills the buffer with a string representing the user's home directory (Unix only). Return the (current) user's home directory.
\wxheading{See also:}
\helpref{wxGetUserHome}{wxgetuserhome}
\wxheading{Include files} \wxheading{Include files}
@@ -1300,8 +1304,7 @@ Fills the buffer with a string representing the user's home directory (Unix only
Copies the host name of the machine the program is running on into the Copies the host name of the machine the program is running on into the
buffer {\it buf}, of maximum size {\it bufSize}, returning TRUE if buffer {\it buf}, of maximum size {\it bufSize}, returning TRUE if
successful. Under Unix, this will return a machine name. Under Windows, successful.
this returns ``windows''.
\wxheading{Include files} \wxheading{Include files}
@@ -1434,6 +1437,18 @@ Under Windows, this returns ``user''.
<wx/utils.h> <wx/utils.h>
\membersection{::wxGetUserHome}\label{wxgetuserhome}
\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
Returns the home directory for the given user. If the username is empty
(default value), this function behaves like
\helpref{wxGetHomeDir}{wxgethomedir}.
\wxheading{Include files}
<wx/utils.h>
\membersection{::wxGetUserName} \membersection{::wxGetUserName}
\func{bool}{wxGetUserName}{\param{const wxString\& }{buf}, \param{int}{ bufSize}} \func{bool}{wxGetUserName}{\param{const wxString\& }{buf}, \param{int}{ bufSize}}

View File

@@ -212,6 +212,7 @@ WXDLLEXPORT bool wxGetUserName(wxChar *buf, int maxSize);
WXDLLEXPORT wxString wxGetUserName(); WXDLLEXPORT wxString wxGetUserName();
// Get current Home dir and copy to dest (returns pstr->c_str()) // Get current Home dir and copy to dest (returns pstr->c_str())
WXDLLEXPORT wxString wxGetHomeDir();
WXDLLEXPORT const wxChar* wxGetHomeDir(wxString *pstr); WXDLLEXPORT const wxChar* wxGetHomeDir(wxString *pstr);
// Get the user's home dir (caller must copy --- volatile) // Get the user's home dir (caller must copy --- volatile)

View File

@@ -1041,3 +1041,10 @@ wxString wxGetFullHostName()
return buf; return buf;
} }
wxString wxGetHomeDir()
{
wxString home;
wxGetHomeDir(&home);
return home;
}