OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 // This command-line program dumps the contents of a set of cache files, either | 5 // This command-line program dumps the contents of a set of cache files, either |
6 // to stdout or to another set of cache files. | 6 // to stdout or to another set of cache files. |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Dumps all entries to stdout. | 50 // Dumps all entries to stdout. |
51 const wchar_t kDumpContents[] = L"dump-contents"; | 51 const wchar_t kDumpContents[] = L"dump-contents"; |
52 | 52 |
53 // Convert the cache to files. | 53 // Convert the cache to files. |
54 const wchar_t kDumpToFiles[] = L"dump-to-files"; | 54 const wchar_t kDumpToFiles[] = L"dump-to-files"; |
55 | 55 |
56 // Upgrade an old version to the current one. | 56 // Upgrade an old version to the current one. |
57 const wchar_t kUpgrade[] = L"upgrade"; | 57 const wchar_t kUpgrade[] = L"upgrade"; |
58 | 58 |
59 // Internal use: | 59 // Internal use: |
60 const wchar_t kSlave[] = L"slave"; | 60 const char kSlave[] = "slave"; |
61 const wchar_t kPipe[] = L"pipe"; | 61 const char kPipe[] = "pipe"; |
62 | 62 |
63 int Help() { | 63 int Help() { |
64 printf("warning: input files are modified by this tool\n"); | 64 printf("warning: input files are modified by this tool\n"); |
65 printf("dump_cache --input=path1 [--output=path2]\n"); | 65 printf("dump_cache --input=path1 [--output=path2]\n"); |
66 printf("--dump-headers: display file headers\n"); | 66 printf("--dump-headers: display file headers\n"); |
67 printf("--dump-contents: display all entries\n"); | 67 printf("--dump-contents: display all entries\n"); |
68 printf("--upgrade: copy contents to the output path\n"); | 68 printf("--upgrade: copy contents to the output path\n"); |
69 printf("--dump-to-files: write the contents of the cache to files\n"); | 69 printf("--dump-to-files: write the contents of the cache to files\n"); |
70 return INVALID_ARGUMENT; | 70 return INVALID_ARGUMENT; |
71 } | 71 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 Sleep(500); | 172 Sleep(500); |
173 return ALL_GOOD; | 173 return ALL_GOOD; |
174 } | 174 } |
175 | 175 |
176 if (command_line.HasSwitch(kDumpContents)) | 176 if (command_line.HasSwitch(kDumpContents)) |
177 return DumpContents(input_path); | 177 return DumpContents(input_path); |
178 if (command_line.HasSwitch(kDumpHeaders)) | 178 if (command_line.HasSwitch(kDumpHeaders)) |
179 return DumpHeaders(input_path); | 179 return DumpHeaders(input_path); |
180 return Help(); | 180 return Help(); |
181 } | 181 } |
OLD | NEW |