Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: third_party/lzma/v4_65/files/CPP/Common/StringConvert.cpp

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/lzma/v4_65/files/CPP/Common/StringConvert.cpp
diff --git a/third_party/lzma/v4_65/files/CPP/Common/StringConvert.cpp b/third_party/lzma/v4_65/files/CPP/Common/StringConvert.cpp
deleted file mode 100644
index 9bd47deb82bbf272d5719e1d593a09d85ebdf5a2..0000000000000000000000000000000000000000
--- a/third_party/lzma/v4_65/files/CPP/Common/StringConvert.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-// Common/StringConvert.cpp
-
-#include "StdAfx.h"
-
-#include "StringConvert.h"
-
-#ifndef _WIN32
-#include <stdlib.h>
-#endif
-
-#ifdef _WIN32
-UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
-{
- UString resultString;
- if (!srcString.IsEmpty())
- {
- int numChars = MultiByteToWideChar(codePage, 0, srcString,
- srcString.Length(), resultString.GetBuffer(srcString.Length()),
- srcString.Length() + 1);
- #ifndef _WIN32_WCE
- if (numChars == 0)
- throw 282228;
- #endif
- resultString.ReleaseBuffer(numChars);
- }
- return resultString;
-}
-
-AString UnicodeStringToMultiByte(const UString &s, UINT codePage, char defaultChar, bool &defaultCharWasUsed)
-{
- AString dest;
- defaultCharWasUsed = false;
- if (!s.IsEmpty())
- {
- int numRequiredBytes = s.Length() * 2;
- BOOL defUsed;
- int numChars = WideCharToMultiByte(codePage, 0, s, s.Length(),
- dest.GetBuffer(numRequiredBytes), numRequiredBytes + 1,
- &defaultChar, &defUsed);
- defaultCharWasUsed = (defUsed != FALSE);
- #ifndef _WIN32_WCE
- if (numChars == 0)
- throw 282229;
- #endif
- dest.ReleaseBuffer(numChars);
- }
- return dest;
-}
-
-AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage)
-{
- bool defaultCharWasUsed;
- return UnicodeStringToMultiByte(srcString, codePage, '_', defaultCharWasUsed);
-}
-
-#ifndef _WIN32_WCE
-AString SystemStringToOemString(const CSysString &srcString)
-{
- AString result;
- CharToOem(srcString, result.GetBuffer(srcString.Length() * 2));
- result.ReleaseBuffer();
- return result;
-}
-#endif
-
-#else
-
-UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
-{
- UString resultString;
- for (int i = 0; i < srcString.Length(); i++)
- resultString += wchar_t(srcString[i]);
- /*
- if (!srcString.IsEmpty())
- {
- int numChars = mbstowcs(resultString.GetBuffer(srcString.Length()), srcString, srcString.Length() + 1);
- if (numChars < 0) throw "Your environment does not support UNICODE";
- resultString.ReleaseBuffer(numChars);
- }
- */
- return resultString;
-}
-
-AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage)
-{
- AString resultString;
- for (int i = 0; i < srcString.Length(); i++)
- resultString += char(srcString[i]);
- /*
- if (!srcString.IsEmpty())
- {
- int numRequiredBytes = srcString.Length() * 6 + 1;
- int numChars = wcstombs(resultString.GetBuffer(numRequiredBytes), srcString, numRequiredBytes);
- if (numChars < 0) throw "Your environment does not support UNICODE";
- resultString.ReleaseBuffer(numChars);
- }
- */
- return resultString;
-}
-
-#endif
-
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Common/StringConvert.h ('k') | third_party/lzma/v4_65/files/CPP/Common/StringToInt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698