OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // See the corresponding header file for description of the functions in this | 5 // See the corresponding header file for description of the functions in this |
6 // file. | 6 // file. |
7 | 7 |
8 #include "chrome/installer/util/install_util.h" | 8 #include "chrome/installer/util/install_util.h" |
9 | 9 |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 std::wstring command; | 256 std::wstring command; |
257 command.append(1, L'"') | 257 command.append(1, L'"') |
258 .append(no_program ? L"" : exe_path) | 258 .append(no_program ? L"" : exe_path) |
259 .append(L"\" ") | 259 .append(L"\" ") |
260 .append(arguments); | 260 .append(arguments); |
261 | 261 |
262 // If we have a program name, return this complete command line. | 262 // If we have a program name, return this complete command line. |
263 *command_line = CommandLine::FromString(command); | 263 *command_line = CommandLine::FromString(command); |
264 } | 264 } |
265 } | 265 } |
| 266 |
| 267 std::wstring InstallUtil::GetCurrentDate() { |
| 268 static const wchar_t kDateFormat[] = L"yyyyMMdd"; |
| 269 wchar_t date_str[arraysize(kDateFormat)] = {0}; |
| 270 int len = GetDateFormatW(LOCALE_INVARIANT, 0, NULL, kDateFormat, |
| 271 date_str, arraysize(date_str)); |
| 272 if (len) { |
| 273 --len; // Subtract terminating \0. |
| 274 } else { |
| 275 PLOG(DFATAL) << "GetDateFormat"; |
| 276 } |
| 277 |
| 278 return std::wstring(date_str, len); |
| 279 } |
OLD | NEW |