added wxXmlResource::LoadFile() to avoid URL-vs-filename ambiguity in Load()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -109,9 +109,12 @@ public:
|
|||||||
virtual ~wxXmlResource();
|
virtual ~wxXmlResource();
|
||||||
|
|
||||||
// Loads resources from XML files that match given filemask.
|
// Loads resources from XML files that match given filemask.
|
||||||
// This method understands VFS (see filesys.h).
|
// This method understands wxFileSystem URLs if wxUSE_FILESYS.
|
||||||
bool Load(const wxString& filemask);
|
bool Load(const wxString& filemask);
|
||||||
|
|
||||||
|
// Loads resources from single XRC file.
|
||||||
|
bool LoadFile(const wxFileName& file);
|
||||||
|
|
||||||
// Unload resource from the given XML file (wildcards not allowed)
|
// Unload resource from the given XML file (wildcards not allowed)
|
||||||
bool Unload(const wxString& filename);
|
bool Unload(const wxString& filename);
|
||||||
|
|
||||||
|
@@ -196,10 +196,27 @@ public:
|
|||||||
wxLogError("Couldn't load resources!");
|
wxLogError("Couldn't load resources!");
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This method understands VFS (see wxFileSystem::FindFirst).
|
@note
|
||||||
|
If wxUSE_FILESYS is enabled, this method understands wxFileSystem URLs
|
||||||
|
(see wxFileSystem::FindFirst()).
|
||||||
|
|
||||||
|
@note
|
||||||
|
If you are sure that the argument is name of single XRC file (rather
|
||||||
|
than an URL or a wildcard), use LoadFile() instead.
|
||||||
|
|
||||||
|
@see LoadFile()
|
||||||
*/
|
*/
|
||||||
bool Load(const wxString& filemask);
|
bool Load(const wxString& filemask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Simpler form of Load() for loading a single XRC file.
|
||||||
|
|
||||||
|
@since 2.9.0
|
||||||
|
|
||||||
|
@see Load()
|
||||||
|
*/
|
||||||
|
bool LoadFile(const wxFileName& file);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Loads a bitmap resource from a file.
|
Loads a bitmap resource from a file.
|
||||||
*/
|
*/
|
||||||
|
@@ -178,6 +178,11 @@ bool wxXmlResource::IsArchive(const wxString& filename)
|
|||||||
|
|
||||||
#endif // wxUSE_FILESYSTEM
|
#endif // wxUSE_FILESYSTEM
|
||||||
|
|
||||||
|
bool wxXmlResource::LoadFile(const wxFileName& file)
|
||||||
|
{
|
||||||
|
return Load(wxFileSystem::FileNameToURL(file));
|
||||||
|
}
|
||||||
|
|
||||||
bool wxXmlResource::Load(const wxString& filemask_)
|
bool wxXmlResource::Load(const wxString& filemask_)
|
||||||
{
|
{
|
||||||
wxString filemask = ConvertFileNameToURL(filemask_);
|
wxString filemask = ConvertFileNameToURL(filemask_);
|
||||||
|
Reference in New Issue
Block a user