update
This commit is contained in:
parent
641256a8db
commit
b622b98f79
@ -50,8 +50,6 @@ namespace hgl
|
||||
*/
|
||||
class AssetsSource
|
||||
{
|
||||
protected:
|
||||
|
||||
UTF8String uri_short_name;
|
||||
|
||||
public:
|
||||
@ -74,12 +72,9 @@ namespace hgl
|
||||
virtual AssetsSource * CreateSubSource (const UTF8String &){return nullptr;}
|
||||
};//class AssetsSource
|
||||
|
||||
AssetsSource *CreateByFilesystem(const UTF8String &sn,const OSString &pathname,const bool only_read);
|
||||
AssetsSource *CreateSourceByFilesystem(const UTF8String &sn,const OSString &pathname,const bool only_read);
|
||||
|
||||
bool RegistryAssetsSource(const UTF8String &uri_short_name,AssetsSource *);
|
||||
void UnregistryAssetsSource(const UTF8String &uri_short_name);
|
||||
|
||||
AssetsSource *GetAssetsSource(const UTF8String &uri_short_name);
|
||||
AssetsSource *GetSource(const UTF8String &uri_short_name);
|
||||
|
||||
io::InputStream *GetAssets(const UTF8String &uri);
|
||||
}//namespace assets
|
||||
|
@ -9,17 +9,6 @@ namespace hgl
|
||||
{
|
||||
Map<UTF8String,AssetsSource *> assets_source_map;
|
||||
}//namespace
|
||||
|
||||
AssetsSource::AssetsSource(const UTF8String &sn)
|
||||
{
|
||||
uri_short_name=sn;
|
||||
RegistryAssetsSource(sn,this);
|
||||
}
|
||||
|
||||
AssetsSource::~AssetsSource()
|
||||
{
|
||||
UnregistryAssetsSource(uri_short_name);
|
||||
}
|
||||
|
||||
bool RegistryAssetsSource(const UTF8String &uri_short_name,AssetsSource *as)
|
||||
{
|
||||
@ -44,7 +33,7 @@ namespace hgl
|
||||
assets_source_map.DeleteByKey(uri_short_name);
|
||||
}
|
||||
|
||||
AssetsSource *GetAssetsSource(const UTF8String &uri_short_name)
|
||||
AssetsSource *GetSource(const UTF8String &uri_short_name)
|
||||
{
|
||||
if(uri_short_name.IsEmpty())
|
||||
return(nullptr);
|
||||
@ -55,7 +44,7 @@ namespace hgl
|
||||
return as;
|
||||
|
||||
return(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
io::InputStream *GetAssets(const UTF8String &uri)
|
||||
{
|
||||
@ -68,8 +57,8 @@ namespace hgl
|
||||
|
||||
const UTF8String sn=uri.SubString(0,pos);
|
||||
|
||||
AssetsSource *source=GetAssetsSource(sn);
|
||||
|
||||
AssetsSource *source=GetSource(uri);
|
||||
|
||||
if(!source)
|
||||
return(nullptr);
|
||||
|
||||
@ -77,5 +66,16 @@ namespace hgl
|
||||
|
||||
return source->OpenByName(surl);
|
||||
}
|
||||
|
||||
AssetsSource::AssetsSource(const UTF8String &sn)
|
||||
{
|
||||
uri_short_name=sn;
|
||||
RegistryAssetsSource(sn,this);
|
||||
}
|
||||
|
||||
AssetsSource::~AssetsSource()
|
||||
{
|
||||
UnregistryAssetsSource(uri_short_name);
|
||||
}
|
||||
}//namespace assets
|
||||
}//namespace hgl
|
@ -39,7 +39,7 @@ namespace hgl
|
||||
}
|
||||
};//class AssetsSourceFilesytem:public AssetsSource
|
||||
|
||||
AssetsSource *CreateByFilesystem(const OSString &path,const bool only_read)
|
||||
AssetsSource *CreateSourceByFilesystem(const OSString &path,const bool only_read)
|
||||
{
|
||||
if(path.IsEmpty())
|
||||
return(nullptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user