Chromium Code Reviews| Index: chrome/browser/extensions/api/declarative/rule_identifier.h |
| diff --git a/chrome/browser/extensions/api/declarative/rule_identifier.h b/chrome/browser/extensions/api/declarative/rule_identifier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1c3a51852b3d35b1a6149769e216b8312f30ae30 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/declarative/rule_identifier.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ |
| +#define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ |
| +#pragma once |
| + |
| +#include <string> |
| + |
| +namespace extensions { |
| + |
| +// A globally unique rule identifier |
| +class RuleIdentifier { |
| + public: |
| + RuleIdentifier(const std::string& extension_id, |
| + const std::string& event_name, |
| + const std::string& rule_id); |
| + RuleIdentifier(const RuleIdentifier& other); |
| + ~RuleIdentifier(); |
| + |
| + const std::string& extension_id() const { return extension_id_; } |
| + const std::string& event_name() const { return event_name_; } |
| + const std::string& rule_id() const { return rule_id_; } |
| + |
| + 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
|
| + 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
|
| + private: |
| + std::string extension_id_; |
| + std::string event_name_; |
| + std::string rule_id_; |
| +}; |
| + |
| +} // extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULE_IDENTIFIER_H__ |