JANITORIAL: Fix indentation issues
This commit is contained in:
parent
3109f2fcbc
commit
f18ee89b27
3 changed files with 19 additions and 19 deletions
|
@ -542,7 +542,7 @@ TEMPLATE void BASESTRING::insertString(const value_type *s, uint32 p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE void BASESTRING::insertString(const BaseString &s, uint32 p) {
|
TEMPLATE void BASESTRING::insertString(const BaseString &s, uint32 p) {
|
||||||
for (uint i = 0; i < s._size; i++) {
|
for (uint i = 0; i < s._size; i++) {
|
||||||
BaseString::insertChar(s[i], p+i);
|
BaseString::insertChar(s[i], p+i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ TEMPLATE uint32 BASESTRING::find(const BaseString &str, uint32 pos) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE size_t BASESTRING::find(const value_type *strP, uint32 pos) const {
|
TEMPLATE size_t BASESTRING::find(const value_type *strP, uint32 pos) const {
|
||||||
if (pos >= _size) {
|
if (pos >= _size) {
|
||||||
return npos;
|
return npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ TEMPLATE void BASESTRING::toLowercase() {
|
||||||
TEMPLATE void BASESTRING::toUppercase() {
|
TEMPLATE void BASESTRING::toUppercase() {
|
||||||
makeUnique();
|
makeUnique();
|
||||||
for (uint32 i = 0; i < _size; ++i) {
|
for (uint32 i = 0; i < _size; ++i) {
|
||||||
if (_str[i] > 0 && _str[i] < 128) {
|
if (_str[i] > 0 && _str[i] < 128) {
|
||||||
_str[i] = toupper(_str[i]);
|
_str[i] = toupper(_str[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -740,7 +740,7 @@ TEMPLATE void BASESTRING::assignAppend(value_type c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEMPLATE void BASESTRING::assignAppend(const BaseString &str) {
|
TEMPLATE void BASESTRING::assignAppend(const BaseString &str) {
|
||||||
if (&str == this) {
|
if (&str == this) {
|
||||||
assignAppend(BaseString(str));
|
assignAppend(BaseString(str));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,9 +32,9 @@ namespace Common {
|
||||||
template<class T>
|
template<class T>
|
||||||
class BaseString {
|
class BaseString {
|
||||||
public:
|
public:
|
||||||
static void releaseMemoryPoolMutex();
|
static void releaseMemoryPoolMutex();
|
||||||
|
|
||||||
static const uint32 npos = 0xFFFFFFFF;
|
static const uint32 npos = 0xFFFFFFFF;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef T * iterator;
|
typedef T * iterator;
|
||||||
typedef const T * const_iterator;
|
typedef const T * const_iterator;
|
||||||
|
@ -119,7 +119,7 @@ public:
|
||||||
bool equalsC(const char *x) const;
|
bool equalsC(const char *x) const;
|
||||||
int compareTo(const BaseString &x) const; // strcmp clone
|
int compareTo(const BaseString &x) const; // strcmp clone
|
||||||
int compareTo(const value_type *x) const; // strcmp clone
|
int compareTo(const value_type *x) const; // strcmp clone
|
||||||
int compareToC(const char *x) const; // strcmp clone
|
int compareToC(const char *x) const; // strcmp clone
|
||||||
|
|
||||||
/** Set character c at position p, replacing the previous character there. */
|
/** Set character c at position p, replacing the previous character there. */
|
||||||
void setChar(value_type c, uint32 p);
|
void setChar(value_type c, uint32 p);
|
||||||
|
@ -165,7 +165,7 @@ public:
|
||||||
return begin() + size();
|
return begin() + size();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const value_type *c_str() const { return _str; }
|
inline const value_type *c_str() const { return _str; }
|
||||||
inline uint size() const { return _size; }
|
inline uint size() const { return _size; }
|
||||||
|
|
||||||
inline bool empty() const { return (_size == 0); }
|
inline bool empty() const { return (_size == 0); }
|
||||||
|
@ -185,16 +185,16 @@ public:
|
||||||
|
|
||||||
/** Insert character c before position p. */
|
/** Insert character c before position p. */
|
||||||
void insertChar(value_type c, uint32 p);
|
void insertChar(value_type c, uint32 p);
|
||||||
void insertString(const value_type *s, uint32 p);
|
void insertString(const value_type *s, uint32 p);
|
||||||
void insertString(const BaseString &s, uint32 p);
|
void insertString(const BaseString &s, uint32 p);
|
||||||
|
|
||||||
/** Finds the index of a character in the string */
|
/** Finds the index of a character in the string */
|
||||||
uint32 find(value_type x, uint32 pos = 0) const;
|
uint32 find(value_type x, uint32 pos = 0) const;
|
||||||
/** Does a find for the passed string */
|
/** Does a find for the passed string */
|
||||||
size_t find(const value_type *s, uint32 pos = 0) const;
|
size_t find(const value_type *s, uint32 pos = 0) const;
|
||||||
uint32 find(const BaseString &str, uint32 pos = 0) const;
|
uint32 find(const BaseString &str, uint32 pos = 0) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps the text in the string to the given line maximum. Lines will be
|
* Wraps the text in the string to the given line maximum. Lines will be
|
||||||
* broken at any whitespace character. New lines are assumed to be
|
* broken at any whitespace character. New lines are assumed to be
|
||||||
* represented using '\n'.
|
* represented using '\n'.
|
||||||
|
@ -205,12 +205,12 @@ public:
|
||||||
*/
|
*/
|
||||||
void wordWrap(const uint32 maxLength);
|
void wordWrap(const uint32 maxLength);
|
||||||
|
|
||||||
/** Return uint64 corrensponding to String's contents. */
|
/** Return uint64 corrensponding to String's contents. */
|
||||||
uint64 asUint64() const;
|
uint64 asUint64() const;
|
||||||
|
|
||||||
/** Return uint64 corrensponding to String's contents. This variant recognizes 0 (oct) and 0x (hex) prefixes. */
|
/** Return uint64 corrensponding to String's contents. This variant recognizes 0 (oct) and 0x (hex) prefixes. */
|
||||||
uint64 asUint64Ext() const;
|
uint64 asUint64Ext() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert all characters in the string to lowercase.
|
* Convert all characters in the string to lowercase.
|
||||||
*
|
*
|
||||||
|
|
|
@ -114,8 +114,8 @@ public:
|
||||||
bool operator!=(const String &x) const;
|
bool operator!=(const String &x) const;
|
||||||
bool operator!=(const char *x) const;
|
bool operator!=(const char *x) const;
|
||||||
|
|
||||||
/** Python-like method **/
|
/** Python-like method **/
|
||||||
String encode(CodePage page = kUtf8) const;
|
String encode(CodePage page = kUtf8) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print formatted data into a U32String object.
|
* Print formatted data into a U32String object.
|
||||||
|
@ -139,7 +139,7 @@ public:
|
||||||
void insertString(const char *s, uint32 p);
|
void insertString(const char *s, uint32 p);
|
||||||
void insertString(const String &s, uint32 p);
|
void insertString(const String &s, uint32 p);
|
||||||
|
|
||||||
/** Return a substring of this string */
|
/** Return a substring of this string */
|
||||||
U32String substr(size_t pos = 0, size_t len = npos) const;
|
U32String substr(size_t pos = 0, size_t len = npos) const;
|
||||||
|
|
||||||
const uint32 *u32_str() const {
|
const uint32 *u32_str() const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue