Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/UI/FileManager/StringUtils.cpp')
-rw-r--r--[-rwxr-xr-x]CPP/7zip/UI/FileManager/StringUtils.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/CPP/7zip/UI/FileManager/StringUtils.cpp b/CPP/7zip/UI/FileManager/StringUtils.cpp
index bddaa971..fb38a735 100755..100644
--- a/CPP/7zip/UI/FileManager/StringUtils.cpp
+++ b/CPP/7zip/UI/FileManager/StringUtils.cpp
@@ -9,8 +9,8 @@ void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2)
dest1.Empty();
dest2.Empty();
bool quoteMode = false;
- int i;
- for (i = 0; i < src.Length(); i++)
+ unsigned i;
+ for (i = 0; i < src.Len(); i++)
{
wchar_t c = src[i];
if (c == L'\"')
@@ -26,43 +26,42 @@ void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2)
else
dest1 += c;
}
- dest2 = src.Mid(i);
+ dest2 = src.Ptr(i);
}
void SplitString(const UString &srcString, UStringVector &destStrings)
{
destStrings.Clear();
- UString string;
- int len = srcString.Length();
+ unsigned len = srcString.Len();
if (len == 0)
return;
- for (int i = 0; i < len; i++)
+ UString s;
+ for (unsigned i = 0; i < len; i++)
{
wchar_t c = srcString[i];
if (c == L' ')
{
- if (!string.IsEmpty())
+ if (!s.IsEmpty())
{
- destStrings.Add(string);
- string.Empty();
+ destStrings.Add(s);
+ s.Empty();
}
}
else
- string += c;
+ s += c;
}
- if (!string.IsEmpty())
- destStrings.Add(string);
+ if (!s.IsEmpty())
+ destStrings.Add(s);
}
UString JoinStrings(const UStringVector &srcStrings)
{
- UString destString;
- for (int i = 0; i < srcStrings.Size(); i++)
+ UString s;
+ FOR_VECTOR (i, srcStrings)
{
if (i != 0)
- destString += L' ';
- destString += srcStrings[i];
+ s += L' ';
+ s += srcStrings[i];
}
- return destString;
+ return s;
}
-