code cleanup: dont set the namespace in STR_String.h - 'using namespace std', since this is included in many places.
This commit is contained in:
@@ -51,8 +51,6 @@
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
#include "MEM_guardedalloc.h"
|
||||
#endif
|
||||
@@ -95,8 +93,10 @@ public:
|
||||
inline void Clear() { Len = pData[0] = 0; }
|
||||
inline const STR_String & Reverse()
|
||||
{
|
||||
for (int i1=0, i2=Len-1; i1<i2; i1++, i2--)
|
||||
swap(pData[i1], pData[i2]); return *this;
|
||||
for (int i1 = 0, i2 = Len - 1; i1 < i2; i1++, i2--) {
|
||||
std::swap(pData[i1], pData[i2]);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Properties
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
int FindOneOf(const char *set, int pos = 0) const;
|
||||
int RFindOneOf(const char *set, int pos = 0) const;
|
||||
|
||||
vector<STR_String> Explode(char c) const;
|
||||
std::vector<STR_String> Explode(char c) const;
|
||||
|
||||
// Formatting
|
||||
STR_String& Upper();
|
||||
|
@@ -699,23 +699,19 @@ rcSTR_String STR_String::Concat(const char *data, int len)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
vector<STR_String> STR_String::Explode(char c) const
|
||||
std::vector<STR_String> STR_String::Explode(char c) const
|
||||
{
|
||||
STR_String lcv = *this;
|
||||
vector<STR_String> uc;
|
||||
STR_String lcv = *this;
|
||||
std::vector<STR_String> uc;
|
||||
|
||||
while (lcv.Length())
|
||||
{
|
||||
int pos = lcv.Find(c);
|
||||
if (pos < 0)
|
||||
{
|
||||
if (pos < 0) {
|
||||
uc.push_back(lcv);
|
||||
lcv.Clear();
|
||||
} else
|
||||
{
|
||||
}
|
||||
else {
|
||||
uc.push_back(lcv.Left(pos));
|
||||
lcv = lcv.Mid(pos+1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user