mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-19 07:21:20 +03:00
import KernelEx-4.0-Final
This commit is contained in:
12
common/sstring.hpp
Executable file → Normal file
12
common/sstring.hpp
Executable file → Normal file
@ -24,6 +24,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/** Simple string container class. */
|
||||
class sstring
|
||||
{
|
||||
public:
|
||||
@ -55,12 +56,21 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
sstring& operator=(const char* src)
|
||||
{
|
||||
len = strlen(src);
|
||||
delete [] storage;
|
||||
storage = new char[len + 1];
|
||||
strcpy(storage, src);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator<(const sstring& a) const
|
||||
{
|
||||
return strcmp(storage, a.storage) < 0;
|
||||
}
|
||||
|
||||
const char* get() const
|
||||
operator const char*() const
|
||||
{
|
||||
return storage;
|
||||
}
|
||||
|
Reference in New Issue
Block a user