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

Unified Diff: third_party/lzma/v4_65/files/CPP/7zip/UI/Common/SetProperties.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/7zip/UI/Common/SetProperties.cpp
diff --git a/third_party/lzma/v4_65/files/CPP/7zip/UI/Common/SetProperties.cpp b/third_party/lzma/v4_65/files/CPP/7zip/UI/Common/SetProperties.cpp
deleted file mode 100644
index 4827f2a78a480dce3b03073e22cd07d93e7cd531..0000000000000000000000000000000000000000
--- a/third_party/lzma/v4_65/files/CPP/7zip/UI/Common/SetProperties.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// SetProperties.cpp
-
-#include "StdAfx.h"
-
-#include "SetProperties.h"
-
-#include "Windows/PropVariant.h"
-#include "Common/MyString.h"
-#include "Common/StringToInt.h"
-#include "Common/MyCom.h"
-
-#include "../../Archive/IArchive.h"
-
-using namespace NWindows;
-using namespace NCOM;
-
-static void ParseNumberString(const UString &s, NCOM::CPropVariant &prop)
-{
- const wchar_t *endPtr;
- UInt64 result = ConvertStringToUInt64(s, &endPtr);
- if (endPtr - (const wchar_t *)s != s.Length())
- prop = s;
- else if (result <= 0xFFFFFFFF)
- prop = (UInt32)result;
- else
- prop = result;
-}
-
-HRESULT SetProperties(IUnknown *unknown, const CObjectVector<CProperty> &properties)
-{
- if (properties.IsEmpty())
- return S_OK;
- CMyComPtr<ISetProperties> setProperties;
- unknown->QueryInterface(IID_ISetProperties, (void **)&setProperties);
- if (!setProperties)
- return S_OK;
-
- UStringVector realNames;
- CPropVariant *values = new CPropVariant[properties.Size()];
- try
- {
- int i;
- for(i = 0; i < properties.Size(); i++)
- {
- const CProperty &property = properties[i];
- NCOM::CPropVariant propVariant;
- UString name = property.Name;
- if (property.Value.IsEmpty())
- {
- if (!name.IsEmpty())
- {
- wchar_t c = name[name.Length() - 1];
- if (c == L'-')
- propVariant = false;
- else if (c == L'+')
- propVariant = true;
- if (propVariant.vt != VT_EMPTY)
- name = name.Left(name.Length() - 1);
- }
- }
- else
- ParseNumberString(property.Value, propVariant);
- realNames.Add(name);
- values[i] = propVariant;
- }
- CRecordVector<const wchar_t *> names;
- for(i = 0; i < realNames.Size(); i++)
- names.Add((const wchar_t *)realNames[i]);
-
- RINOK(setProperties->SetProperties(&names.Front(), values, names.Size()));
- }
- catch(...)
- {
- delete []values;
- throw;
- }
- delete []values;
- return S_OK;
-}

Powered by Google App Engine
This is Rietveld 408576698