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

Unified Diff: experimental/windows_debugger/debugger/base/debug_command_line.cc

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 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: experimental/windows_debugger/debugger/base/debug_command_line.cc
diff --git a/experimental/windows_debugger/debugger/base/debug_command_line.cc b/experimental/windows_debugger/debugger/base/debug_command_line.cc
deleted file mode 100644
index 7ad29bdfa306d73d46c549669c59629b12893f53..0000000000000000000000000000000000000000
--- a/experimental/windows_debugger/debugger/base/debug_command_line.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2011 The Native Client SDK Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can
-// be found in the LICENSE file.
-
-#include "debugger/base/debug_command_line.h"
-
-namespace {
-std::string AddDashedPrefix(const std::string& name) {
- std::string result = name;
- while (0 != strncmp(result.c_str(), "--", 2)) {
- result = std::string("-") + result;
- }
- return result;
-}
-} // namespace
-
-namespace debug {
-CommandLine::CommandLine(int argc, char* argv[])
- : argc_(argc),
- argv_(argv) {
-}
-
-CommandLine::~CommandLine() {}
-
-bool HasSpace(const char* str) {
- while(*str) {
- if (isspace(*str++))
- return true;
- }
- return false;
-}
-
-std::string CommandLine::ToString() const {
- std::string str;
- for (int i = 0; i < argc_; i++) {
- if (i > 0)
- str += " ";
- if(HasSpace(argv_[i])) {
- char tmp[4096] = {0};
- _snprintf_s(tmp, sizeof(tmp), "\"%s\"");
- str += tmp;
- } else {
- str += argv_[i];
- }
- }
- return str;
-}
-
-std::string CommandLine::GetStringSwitch(
- const std::string& name, const std::string& default_value) const {
- std::string value = default_value;
- std::string name_with_two_dashes = AddDashedPrefix(name);
- for (int i = 1; (i + 1) < argc_; i++) {
- if (AddDashedPrefix(argv_[i]) == name_with_two_dashes) {
- value = argv_[i + 1];
- break;
- }
- }
- return value;
-}
-
-int CommandLine::GetIntSwitch(const std::string& name,
- int default_value) const {
- int value = default_value;
- std::string str = GetStringSwitch(name, "");
- if (0 != str.size())
- value = atoi(str.c_str());
- return value;
-}
-
-bool CommandLine::HasSwitch(const std::string& name) const {
- std::string name_with_two_dashes = AddDashedPrefix(name);
- for (int i = 1; i < argc_; i++) {
- if (AddDashedPrefix(argv_[i]) == name_with_two_dashes)
- return true;
- }
- return false;
-}
-} // namespace debug
-
-

Powered by Google App Engine
This is Rietveld 408576698