OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <stdbool.h> |
| 6 #include <stddef.h> |
| 7 #include <map> |
| 8 #include <string> |
| 9 #include <utility> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/basictypes.h" |
5 #include "base/command_line.h" | 13 #include "base/command_line.h" |
6 | |
7 #include <algorithm> | |
8 | |
9 #include "base/file_path.h" | 14 #include "base/file_path.h" |
10 #include "base/file_util.h" | |
11 #include "base/logging.h" | 15 #include "base/logging.h" |
12 #include "base/singleton.h" | 16 #include "base/string_piece.h" |
13 #include "base/string_split.h" | 17 #include "base/string_split.h" |
14 #include "base/string_util.h" | 18 #include "base/string_util.h" |
15 #include "base/sys_string_conversions.h" | |
16 #include "base/utf_string_conversions.h" | |
17 #include "build/build_config.h" | 19 #include "build/build_config.h" |
18 | 20 |
19 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 22 #include <shellapi.h> |
20 #include <windows.h> | 23 #include <windows.h> |
21 #include <shellapi.h> | |
22 #elif defined(OS_POSIX) | 24 #elif defined(OS_POSIX) |
23 #include <limits.h> | |
24 #include <stdlib.h> | |
25 #include <unistd.h> | |
26 #endif | 25 #endif |
27 | 26 |
28 CommandLine* CommandLine::current_process_commandline_ = NULL; | 27 CommandLine* CommandLine::current_process_commandline_ = NULL; |
29 | 28 |
30 // Since we use a lazy match, make sure that longer versions (like L"--") | 29 // Since we use a lazy match, make sure that longer versions (like L"--") |
31 // are listed before shorter versions (like L"-") of similar prefixes. | 30 // are listed before shorter versions (like L"-") of similar prefixes. |
32 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
33 const wchar_t* const kSwitchPrefixes[] = {L"--", L"-", L"/"}; | 32 const wchar_t* const kSwitchPrefixes[] = {L"--", L"-", L"/"}; |
34 const wchar_t kSwitchTerminator[] = L"--"; | 33 const wchar_t kSwitchTerminator[] = L"--"; |
35 const wchar_t kSwitchValueSeparator[] = L"="; | 34 const wchar_t kSwitchValueSeparator[] = L"="; |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 472 |
474 // private | 473 // private |
475 CommandLine::CommandLine() { | 474 CommandLine::CommandLine() { |
476 } | 475 } |
477 | 476 |
478 // static | 477 // static |
479 CommandLine* CommandLine::ForCurrentProcessMutable() { | 478 CommandLine* CommandLine::ForCurrentProcessMutable() { |
480 DCHECK(current_process_commandline_); | 479 DCHECK(current_process_commandline_); |
481 return current_process_commandline_; | 480 return current_process_commandline_; |
482 } | 481 } |
OLD | NEW |