Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 namespace extensions { | |
| 12 | |
| 13 // A globally unique rule identifier | |
| 14 class RuleIdentifier { | |
| 15 public: | |
| 16 RuleIdentifier(const std::string& extension_id, | |
| 17 const std::string& event_name, | |
| 18 const std::string& rule_id); | |
| 19 RuleIdentifier(const RuleIdentifier& other); | |
| 20 ~RuleIdentifier(); | |
| 21 | |
| 22 const std::string& extension_id() const { return extension_id_; } | |
| 23 const std::string& event_name() const { return event_name_; } | |
| 24 const std::string& rule_id() const { return rule_id_; } | |
| 25 | |
| 26 bool operator<(const RuleIdentifier& other) const; | |
|
not at google - send to devlin
2012/02/02 11:59:16
why do you need to overload < ?
Aaron Boodman
2012/02/02 16:28:51
It is so that RuleIdentifier can be used with std:
battre
2012/02/02 19:12:36
To store these elements in a std::set.
not at google - send to devlin
2012/02/03 13:06:20
I see.
I'm idly wondering whether it's possible t
| |
| 27 RuleIdentifier& operator=(const RuleIdentifier& other); | |
|
not at google - send to devlin
2012/02/02 11:59:16
i don't think you need to override this.
Aaron Boodman
2012/02/02 16:28:51
Not sure about this one. Maybe some other STL cont
battre
2012/02/02 19:12:36
I think the style guide is not exactly clear, but
| |
| 28 private: | |
| 29 std::string extension_id_; | |
| 30 std::string event_name_; | |
| 31 std::string rule_id_; | |
| 32 }; | |
| 33 | |
| 34 } // extensions | |
| 35 | |
| 36 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ | |
| OLD | NEW |