| OLD | NEW |
| 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 // Helper functions that allow to map enum values to strings. | 5 // Helper functions that allow to map enum values to strings. |
| 6 | 6 |
| 7 #ifndef REMOTING_PROTOCOL_NAME_VALUE_MAP_H_ |
| 8 #define REMOTING_PROTOCOL_NAME_VALUE_MAP_H_ |
| 9 |
| 7 #include <stddef.h> | 10 #include <stddef.h> |
| 8 | 11 |
| 9 #include "base/logging.h" | 12 #include "base/logging.h" |
| 10 | 13 |
| 11 namespace remoting { | 14 namespace remoting { |
| 12 namespace protocol { | 15 namespace protocol { |
| 13 | 16 |
| 14 template <typename T> | 17 template <typename T> |
| 15 struct NameMapElement { | 18 struct NameMapElement { |
| 16 const T value; | 19 const T value; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 35 if (map[i].name == name) { | 38 if (map[i].name == name) { |
| 36 *result = map[i].value; | 39 *result = map[i].value; |
| 37 return true; | 40 return true; |
| 38 } | 41 } |
| 39 } | 42 } |
| 40 return false; | 43 return false; |
| 41 } | 44 } |
| 42 | 45 |
| 43 } // namespace protocol | 46 } // namespace protocol |
| 44 } // namespace remoting | 47 } // namespace remoting |
| 48 |
| 49 #endif // REMOTING_PROTOCOL_NAME_VALUE_MAP_H_ |
| OLD | NEW |