support IntText(),UnsignedText(),Int64Text() for hex value

This commit is contained in:
netcan
2020-02-15 21:35:58 +08:00
parent ff61650517
commit dfb45cb73b
3 changed files with 30 additions and 5 deletions

View File

@@ -590,6 +590,13 @@ public:
|| ch == '-';
}
inline static bool IsPrefixHex( const char* p) {
while (p && *p != '\0' && !isdigit(*p)) {
++p;
}
return *p == '0' && ( *(p + 1) == 'x' || *(p + 1) == 'X');
}
inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) {
if ( p == q ) {
return true;
@@ -1478,7 +1485,7 @@ public:
XMLAttribute* a = FindOrCreateAttribute(name);
a->SetAttribute(value);
}
/// Sets the named attribute to value.
void SetAttribute( const char* name, bool value ) {
XMLAttribute* a = FindOrCreateAttribute( name );