Make wxStandardPaths::AppendAppInfo() public

This function can be useful to the application code and will be used by
wxFileConfig in the upcoming commits.
This commit is contained in:
Vadim Zeitlin 2024-01-02 01:57:04 +01:00
parent 420983f76a
commit 72c164f28c
2 changed files with 20 additions and 4 deletions

View file

@ -184,6 +184,10 @@ public:
bool UsesAppInfo(int info) const { return (m_usedAppInfo & info) != 0; }
// append application information determined by m_usedAppInfo to dir
wxString AppendAppInfo(const wxString& dir) const;
void SetFileLayout(FileLayout layout)
{
m_fileLayout = layout;
@ -203,10 +207,6 @@ protected:
// path separator or dot (.) is not already at the end of dir
static wxString AppendPathComponent(const wxString& dir, const wxString& component);
// append application information determined by m_usedAppInfo to dir
wxString AppendAppInfo(const wxString& dir) const;
// combination of AppInfo_XXX flags used by AppendAppInfo()
int m_usedAppInfo;

View file

@ -195,6 +195,20 @@ public:
ConfigFileConv_Ext
};
/**
Append application and/or vendor name to the given directory.
By default, appends the subdirectory with the application name, as
returned by wxApp::GetAppName(), to the given directory.
This behaviour is affected by UseAppInfo(), e.g. if this function is
called with `AppInfo_VendorName` then the vendor name would be appended
instead of the application name.
@since 3.3.0
*/
wxString AppendAppInfo(const wxString& dir) const;
/**
MSW-specific function undoing the effect of IgnoreAppSubDir() calls.
@ -513,6 +527,8 @@ public:
By default, only the application name is used.
@see AppendAppInfo()
@since 2.9.0
*/
void UseAppInfo(int info);