28 lines
519 B
C++
28 lines
519 B
C++
|
|
#include "unicode.h"
|
|
#include <string.h>
|
|
|
|
unistring & unistring::operator=(const char * ascii_str)
|
|
{
|
|
chars.clear();
|
|
const char * as_ptr = ascii_str;
|
|
while (*as_ptr != '\0')
|
|
{
|
|
chars.push_back(*as_ptr);
|
|
}
|
|
return *this;
|
|
}
|
|
|
|
bool unistring::operator==(const char * ascii_str)
|
|
{
|
|
int len = chars.size();
|
|
if (len != strlen(ascii_str))
|
|
return false;
|
|
for (int i = 0; i < len; i++)
|
|
{
|
|
if (chars[i] != ascii_str[i])
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|