mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
Added Util::Stricmp() and small tweak to serialization of Util::Format
This commit is contained in:
parent
2efe18b525
commit
f08ad1584f
|
@ -67,4 +67,18 @@ namespace Util
|
|||
{
|
||||
return Hex(n, 2);
|
||||
}
|
||||
|
||||
int Stricmp(const char *s1, const char *s2)
|
||||
{
|
||||
int cmp;
|
||||
char c1;
|
||||
char c2;
|
||||
do
|
||||
{
|
||||
c1 = *s1++;
|
||||
c2 = *s2++;
|
||||
cmp = unsigned(tolower(c1)) - unsigned(tolower(c2));
|
||||
} while ((cmp == 0) && (c1 != '\0') && (c2 != '\0'));
|
||||
return cmp;
|
||||
}
|
||||
} // Util
|
||||
|
|
|
@ -31,7 +31,8 @@ namespace Util
|
|||
|
||||
void Write(std::ostream &os) const
|
||||
{
|
||||
os << m_stream.rdbuf();
|
||||
if (m_stream.rdbuf()->in_avail())
|
||||
os << m_stream.rdbuf();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@ -98,6 +99,8 @@ namespace Util
|
|||
std::string Hex(uint32_t n);
|
||||
std::string Hex(uint16_t n);
|
||||
std::string Hex(uint8_t n);
|
||||
|
||||
int Stricmp(const char *s1, const char *s2);
|
||||
} // Util
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue