port to C17/C++20

This commit is contained in:
2024-07-25 02:59:53 +08:00
parent 51f5b2ca59
commit 259f0ef40c
14 changed files with 26 additions and 26 deletions

View File

@@ -266,7 +266,7 @@ namespace hgl
const int hash_bytes=hash_code_bytes[(size_t)ha];
uint8 *hash_code=new uint8[hash_bytes];
char *hash_code_str=new char[1+(hash_bytes<<1)];
u8char *hash_code_str=new u8char[1+(hash_bytes<<1)];
h->Init();
h->Update(data,size);

View File

@@ -37,7 +37,7 @@ namespace hgl
public:
void GetName(UTF8String &str)const override{str="SHA1LE";}
void GetName(UTF8String &str)const override{str=U8_TEXT("SHA1LE");}
void GetName(UTF16String &str)const override{str=U16_TEXT("SHA1LE");}
const int GetHashBytes()const override {return DIGEST_SIZE;}

View File

@@ -280,10 +280,10 @@ namespace hgl
return pa_map.Add(name,attr);
}
bool Add(const PString &str)
{
return Add(pa_name,str);
}
//bool Add(const PString &str)
//{
// return Add(pa_name,str);
//}
PAttribBase<C> *Get(const PString &name){return GetObjectFromList(pa_map,name);}
@@ -298,7 +298,7 @@ namespace hgl
};
};//template<typename C> class PAttribSet
using UTF8PAttribSet =PAttribSet<char>;
using UTF8PAttribSet =PAttribSet<u8char>;
using UTF16PAttribSet =PAttribSet<u16char>;
using WidePAttribSet =PAttribSet<wchar_t>;
using OSPAttribSet =PAttribSet<os_char>;

View File

@@ -17,7 +17,7 @@ namespace hgl
protected:
Map<AnsiString,ElementCreater *> ecs_map;
Map<UTF8String,ElementCreater *> ecs_map;
virtual ElementCreater *GetSubElementCreater(const UTF8String &sub_name);
@@ -133,7 +133,7 @@ namespace hgl
{
Stack<ElementCreater *> ecs_stack;
Map<AnsiString,ElementCreater *> ecs_map;
Map<UTF8String,ElementCreater *> ecs_map;
ElementCreater *cur_ec;