BoxSizer to Sizer
This commit is contained in:
@@ -19,12 +19,12 @@ cString::cString()
|
||||
clear();
|
||||
}
|
||||
|
||||
cString::cString(const char* s)
|
||||
cString::cString( const char* s )
|
||||
{
|
||||
copy_str(s);
|
||||
}
|
||||
|
||||
cString::cString(const cString& copy)
|
||||
cString::cString( const cString& copy )
|
||||
{
|
||||
copy_str(copy);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ cString::~cString()
|
||||
clear();
|
||||
}
|
||||
|
||||
const char* cString::alloc_str(size_t sz)
|
||||
const char* cString::alloc_str( size_t sz )
|
||||
{
|
||||
if (mp_str)
|
||||
clear();
|
||||
@@ -57,7 +57,7 @@ const char* cString::c_str() const
|
||||
return mp_str;
|
||||
}
|
||||
|
||||
const char* cString::copy_str(const char* copy)
|
||||
const char* cString::copy_str( const char* copy )
|
||||
{
|
||||
if (copy) {
|
||||
size_t len = strnlen(copy, __cString__MAX_LEN);
|
||||
@@ -87,7 +87,7 @@ size_t cString::size() const
|
||||
}
|
||||
|
||||
/// string format
|
||||
cString& cString::format(const char* format, ...)
|
||||
cString& cString::format( const char* format, ... )
|
||||
{
|
||||
char * buffer;
|
||||
|
||||
@@ -165,18 +165,18 @@ const char& cString::last_char() const
|
||||
}
|
||||
|
||||
/// non-destructive split
|
||||
const std::vector<cString> cString::split(const char match) const
|
||||
const std::vector<cString> cString::split( const char match ) const
|
||||
{
|
||||
const char match_s[2] = { match, 0 };
|
||||
return split(match_s, -1);
|
||||
}
|
||||
|
||||
const std::vector<cString> cString::split(const char* match) const
|
||||
const std::vector<cString> cString::split( const char* match ) const
|
||||
{
|
||||
return split(match, -1);
|
||||
}
|
||||
|
||||
const std::vector<cString> cString::split(const char* match, int max_split) const
|
||||
const std::vector<cString> cString::split( const char* match, int max_split ) const
|
||||
{
|
||||
std::vector<cString> rtn;
|
||||
if (length() < 1)
|
||||
@@ -206,7 +206,7 @@ const std::vector<cString> cString::split(const char* match, int max_split) cons
|
||||
return rtn;
|
||||
}
|
||||
|
||||
const cString& cString::char_repl(const char& match, const char& repl)
|
||||
const cString& cString::char_repl( const char& match, const char& repl )
|
||||
{
|
||||
for (size_t i = 0; mp_str[i]; ++i) {
|
||||
if (mp_str[i] == match) mp_str[i] = repl;
|
||||
@@ -214,7 +214,7 @@ const cString& cString::char_repl(const char& match, const char& repl)
|
||||
return *this;
|
||||
}
|
||||
|
||||
long int cString::char_find(const char& match) const
|
||||
long int cString::char_find( const char& match ) const
|
||||
{
|
||||
for (size_t i = 0; mp_str[i]; ++i) {
|
||||
if (mp_str[i] == match)
|
||||
@@ -223,7 +223,7 @@ long int cString::char_find(const char& match) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
cString cString::substr(size_t start, size_t length) const
|
||||
cString cString::substr( size_t start, size_t length ) const
|
||||
{
|
||||
cString rs;
|
||||
char * buf;
|
||||
@@ -242,7 +242,7 @@ cString cString::substr(size_t start, size_t length) const
|
||||
return rs;
|
||||
}
|
||||
|
||||
long int cString::find(const cString& match)
|
||||
long int cString::find( const cString& match )
|
||||
{
|
||||
char * pos = strstr(mp_str, match.c_str());
|
||||
if (pos)
|
||||
@@ -251,7 +251,7 @@ long int cString::find(const cString& match)
|
||||
return -1;
|
||||
}
|
||||
|
||||
const cString cString::replace(const cString& match, const cString& repl)
|
||||
const cString cString::replace( const cString& match, const cString& repl )
|
||||
{
|
||||
cString rs;
|
||||
long f1 = find(match);
|
||||
@@ -296,25 +296,25 @@ const long int cString::ToInt() const
|
||||
return strtol(mp_str, NULL, 10);
|
||||
}
|
||||
|
||||
cString& cString::operator = (const char* rhs)
|
||||
cString& cString::operator = ( const char* rhs )
|
||||
{
|
||||
copy_str(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
cString& cString::operator = (const cString& rhs)
|
||||
cString& cString::operator = ( const cString& rhs )
|
||||
{
|
||||
copy_str(rhs.c_str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
cString& cString::operator += (const char rhs)
|
||||
cString& cString::operator += ( const char rhs )
|
||||
{
|
||||
operator+=(&rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
cString& cString::operator += (const char* rhs)
|
||||
cString& cString::operator += ( const char* rhs )
|
||||
{
|
||||
if (rhs) {
|
||||
size_t newlen = m_len + strnlen(rhs, __cString__MAX_LEN);
|
||||
@@ -335,13 +335,13 @@ cString& cString::operator += (const char* rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
cString& cString::operator += (const cString& rhs)
|
||||
cString& cString::operator += ( const cString& rhs )
|
||||
{
|
||||
operator+=(rhs.c_str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool cString::operator == (const char* rhs) const
|
||||
bool cString::operator == ( const char* rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs, __cString__MAX_LEN) == 0)
|
||||
return true;
|
||||
@@ -349,7 +349,7 @@ bool cString::operator == (const char* rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator == (const cString& rhs) const
|
||||
bool cString::operator == ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) == 0)
|
||||
return true;
|
||||
@@ -357,7 +357,7 @@ bool cString::operator == (const cString& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator != (const char* rhs) const
|
||||
bool cString::operator != ( const char* rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs, __cString__MAX_LEN) != 0)
|
||||
return true;
|
||||
@@ -365,7 +365,7 @@ bool cString::operator != (const char* rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator != (const cString& rhs) const
|
||||
bool cString::operator != ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) != 0)
|
||||
return true;
|
||||
@@ -373,7 +373,7 @@ bool cString::operator != (const cString& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator > (const cString& rhs) const
|
||||
bool cString::operator > ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) > 0)
|
||||
return true;
|
||||
@@ -381,7 +381,7 @@ bool cString::operator > (const cString& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator < (const cString& rhs) const
|
||||
bool cString::operator < ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) < 0)
|
||||
return true;
|
||||
@@ -389,7 +389,7 @@ bool cString::operator < (const cString& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator >= (const cString& rhs) const
|
||||
bool cString::operator >= ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) >= 0)
|
||||
return true;
|
||||
@@ -397,7 +397,7 @@ bool cString::operator >= (const cString& rhs) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cString::operator <= (const cString& rhs) const
|
||||
bool cString::operator <= ( const cString& rhs ) const
|
||||
{
|
||||
if (std::strncmp(this->c_str(), rhs.c_str(), __cString__MAX_LEN) <= 0)
|
||||
return true;
|
||||
@@ -414,7 +414,7 @@ cString::operator std::string () const
|
||||
return std::string(c_str());
|
||||
}
|
||||
|
||||
cString operator + (const cString& lhs, const cString& rhs)
|
||||
cString operator + ( const cString& lhs, const cString& rhs )
|
||||
{
|
||||
cString rs = lhs;
|
||||
rs += rhs;
|
||||
|
||||
Reference in New Issue
Block a user