Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: shell/src/Main.cpp

Issue 5163715573841920: Issue 768 - Switch from TR1 to C++11 (Closed)
Patch Set: Created July 11, 2014, 2:24 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 18 matching lines...) Expand all
29 namespace 29 namespace
30 { 30 {
31 void Add(CommandMap& commands, Command* command) 31 void Add(CommandMap& commands, Command* command)
32 { 32 {
33 commands[command->name] = command; 33 commands[command->name] = command;
34 } 34 }
35 35
36 bool ReadCommandLine(std::string& commandLine) 36 bool ReadCommandLine(std::string& commandLine)
37 { 37 {
38 std::cout << "> "; 38 std::cout << "> ";
39 const bool success = std::getline(std::cin, commandLine); 39 const bool success = std::getline(std::cin, commandLine).good();
40 if (!success) 40 if (!success)
41 std::cout << std::endl; 41 std::cout << std::endl;
42 return success; 42 return success;
43 } 43 }
44 44
45 void ParseCommandLine(const std::string& commandLine, std::string& name, 45 void ParseCommandLine(const std::string& commandLine, std::string& name,
46 std::string& arguments) 46 std::string& arguments)
47 { 47 {
48 std::istringstream lineStream(commandLine); 48 std::istringstream lineStream(commandLine);
49 lineStream >> name; 49 lineStream >> name;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 std::cout << error.what() << std::endl; 91 std::cout << error.what() << std::endl;
92 } 92 }
93 } 93 }
94 } 94 }
95 catch (const std::exception& e) 95 catch (const std::exception& e)
96 { 96 {
97 std::cerr << "Exception: " << e.what() << std::endl; 97 std::cerr << "Exception: " << e.what() << std::endl;
98 } 98 }
99 return 0; 99 return 0;
100 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld