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

Side by Side Diff: dbus/object_path.h

Issue 10502011: Explicitly CHECK arguments in dbus::MessageWriter::AppendString/ObjectPath (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 8 years, 6 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
« no previous file with comments | « dbus/message.cc ('k') | dbus/object_path.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef DBUS_OBJECT_PATH_H_ 5 #ifndef DBUS_OBJECT_PATH_H_
6 #define DBUS_OBJECT_PATH_H_ 6 #define DBUS_OBJECT_PATH_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 11 matching lines...) Expand all
22 // 22 //
23 // The compiler synthesised copy constructor and assignment operator are 23 // The compiler synthesised copy constructor and assignment operator are
24 // sufficient for our needs, as is implicit initialization of a std::string 24 // sufficient for our needs, as is implicit initialization of a std::string
25 // from a string constant. 25 // from a string constant.
26 ObjectPath() {} 26 ObjectPath() {}
27 explicit ObjectPath(const std::string& value) : value_(value) {} 27 explicit ObjectPath(const std::string& value) : value_(value) {}
28 28
29 // Retrieves value as a std::string. 29 // Retrieves value as a std::string.
30 const std::string& value() const { return value_; } 30 const std::string& value() const { return value_; }
31 31
32 // Returns true if the value is a valid object path.
33 bool IsValid() const;
34
32 // Permit sufficient comparison to allow an ObjectPath to be used as a 35 // Permit sufficient comparison to allow an ObjectPath to be used as a
33 // key in a std::map. 36 // key in a std::map.
34 bool operator<(const ObjectPath&) const; 37 bool operator<(const ObjectPath&) const;
35 38
36 // Permit testing for equality, required for mocks to work and useful for 39 // Permit testing for equality, required for mocks to work and useful for
37 // observers. 40 // observers.
38 bool operator==(const ObjectPath&) const; 41 bool operator==(const ObjectPath&) const;
39 bool operator!=(const ObjectPath&) const; 42 bool operator!=(const ObjectPath&) const;
40 private: 43 private:
41 std::string value_; 44 std::string value_;
42 }; 45 };
43 46
44 } // namespace dbus 47 } // namespace dbus
45 48
46 #endif // DBUS_OBJECT_PATH_H_ 49 #endif // DBUS_OBJECT_PATH_H_
OLDNEW
« no previous file with comments | « dbus/message.cc ('k') | dbus/object_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698