From 878335ba9c4159d558f41c47783447092e0602c9 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Sat, 4 Jan 2025 14:14:19 +0800 Subject: [PATCH] update String<> names --- inc/hgl/assets/AssetsSource.h | 16 ++++++++-------- src/AssetsSource.cpp | 16 ++++++++-------- src/AssetsSourceFilesystem.cpp | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/inc/hgl/assets/AssetsSource.h b/inc/hgl/assets/AssetsSource.h index 4f4b30b..e28ace5 100644 --- a/inc/hgl/assets/AssetsSource.h +++ b/inc/hgl/assets/AssetsSource.h @@ -46,15 +46,15 @@ namespace hgl */ class AssetsSource { - UTF8String uri_short_name; + U8String uri_short_name; public: - const UTF8String &GetURI()const{return uri_short_name;} + const U8String &GetURI()const{return uri_short_name;} public: - AssetsSource(const UTF8String &); + AssetsSource(const U8String &); virtual ~AssetsSource(); virtual bool hasAnonymousAccess ()const{return false;} @@ -64,15 +64,15 @@ namespace hgl public: - virtual io::InputStream * Open (const UTF8String &){return nullptr;} - virtual AssetsSource * CreateSubSource (const UTF8String &){return nullptr;} + virtual io::InputStream * Open (const U8String &){return nullptr;} + virtual AssetsSource * CreateSubSource (const U8String &){return nullptr;} };//class AssetsSource - AssetsSource *CreateSourceByFilesystem(const UTF8String &sn,const OSString &pathname,const bool only_read); + AssetsSource *CreateSourceByFilesystem(const U8String &sn,const OSString &pathname,const bool only_read); - AssetsSource *GetSource(const UTF8String &uri_short_name); + AssetsSource *GetSource(const U8String &uri_short_name); - io::InputStream *GetAssets(const UTF8String &uri); + io::InputStream *GetAssets(const U8String &uri); }//namespace assets }//namespace hgl #endif//HGL_ASSETS_SOURCE_INCLUDE diff --git a/src/AssetsSource.cpp b/src/AssetsSource.cpp index 583bdd5..6010b0b 100644 --- a/src/AssetsSource.cpp +++ b/src/AssetsSource.cpp @@ -7,10 +7,10 @@ namespace hgl { namespace { - Map assets_source_map; + Map assets_source_map; }//namespace - bool RegistryAssetsSource(const UTF8String &uri_short_name,AssetsSource *as) + bool RegistryAssetsSource(const U8String &uri_short_name,AssetsSource *as) { if(!as) return(false); @@ -25,7 +25,7 @@ namespace hgl return(true); } - void UnregistryAssetsSource(const UTF8String &uri_short_name) + void UnregistryAssetsSource(const U8String &uri_short_name) { if(uri_short_name.IsEmpty()) return; @@ -33,7 +33,7 @@ namespace hgl assets_source_map.DeleteByKey(uri_short_name); } - AssetsSource *GetSource(const UTF8String &uri_short_name) + AssetsSource *GetSource(const U8String &uri_short_name) { if(uri_short_name.IsEmpty()) return(nullptr); @@ -46,7 +46,7 @@ namespace hgl return(nullptr); } - io::InputStream *GetAssets(const UTF8String &uri) + io::InputStream *GetAssets(const U8String &uri) { int pos=uri.FindChar(':'); @@ -55,19 +55,19 @@ namespace hgl if(uri.Comp(pos,u8"://",3)) return(nullptr); - const UTF8String sn=uri.SubString(0,pos); + const U8String sn=uri.SubString(0,pos); AssetsSource *source=GetSource(uri); if(!source) return(nullptr); - const UTF8String surl=uri.SubString(pos+3); + const U8String surl=uri.SubString(pos+3); return source->Open(surl); } - AssetsSource::AssetsSource(const UTF8String &sn) + AssetsSource::AssetsSource(const U8String &sn) { uri_short_name=sn; RegistryAssetsSource(sn,this); diff --git a/src/AssetsSourceFilesystem.cpp b/src/AssetsSourceFilesystem.cpp index 0722c29..35ec159 100644 --- a/src/AssetsSourceFilesystem.cpp +++ b/src/AssetsSourceFilesystem.cpp @@ -14,7 +14,7 @@ namespace hgl public: - AssetsSourceFilesytem(const UTF8String &sn,const OSString &path,const bool _or):AssetsSource(sn) + AssetsSourceFilesytem(const U8String &sn,const OSString &path,const bool _or):AssetsSource(sn) { root_path=path; only_read=_or; @@ -22,7 +22,7 @@ namespace hgl bool hasNameAccess()const override{return true;} - io::InputStream *Open(const UTF8String &filename) + io::InputStream *Open(const U8String &filename) { const OSString &fullname=filesystem::MergeFilename(root_path,ToOSString(filename)); @@ -39,7 +39,7 @@ namespace hgl } };//class AssetsSourceFilesytem:public AssetsSource - AssetsSource *CreateSourceByFilesystem(const UTF8String &uri,const OSString &path,const bool only_read) + AssetsSource *CreateSourceByFilesystem(const U8String &uri,const OSString &path,const bool only_read) { if(!uri.IsEmpty()) {