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

Side by Side Diff: chromeos/dbus/dbus_command_line_helper.h

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_DBUS_COMMAND_LINE_HELPER_H_
6 #define CHROMEOS_DBUS_DBUS_COMMAND_LINE_HELPER_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "chromeos/chromeos_export.h"
12
13 namespace dbus_command_line_helper {
14
15 // Parses a single name,value pair. Returns 'true' if parsed successfully.
16 typedef base::Callback<
17 bool(const std::string& arg0, const std::string& arg1)> ParseOptionCallback;
18
19 // Parses a command line switch containing comma-separated name-value pairs.
20 // Invokes |callback| for each name-value pair. Returns false only if the
21 // option is not set in the command line.
22 // Examples:
23 // Invokes |callback| once with ("foo", ""):
24 // --option=foo
25 // Invokes |callback| three times with ("foo", ""), ("bar", "1"), ("a", "b")
26 // --option=foo,bar=1,a=b
27 CHROMEOS_EXPORT bool ParseOptions(const std::string& switch_name,
28 const ParseOptionCallback& callback);
29
30 } // namespace dbus_command_line_helper
31
32
33 #endif // CHROMEOS_DBUS_DBUS_COMMAND_LINE_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698