OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 // Utilities for plugins for the cromo modem manager. | 5 // Utilities for plugins for the cromo modem manager. |
6 | 6 |
7 #ifndef CROMO_UTILITIES_H_ | 7 #ifndef CROMO_UTILITIES_H_ |
8 #define CROMO_UTILITIES_H_ | 8 #define CROMO_UTILITIES_H_ |
9 | 9 |
10 #include <base/basictypes.h> | 10 #include <base/basictypes.h> |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Extracts the key from proprties, returning not_found_response if | 21 // Extracts the key from proprties, returning not_found_response if |
22 // the key is not found. If key is found, but is not a string, sets | 22 // the key is not found. If key is found, but is not a string, sets |
23 // error and returns not_found_response. If error.is_set() is true, | 23 // error and returns not_found_response. If error.is_set() is true, |
24 // ExtractString will not report further errors. You can make | 24 // ExtractString will not report further errors. You can make |
25 // multiple ExtractString calls and check error at the end. | 25 // multiple ExtractString calls and check error at the end. |
26 const char *ExtractString(const DBusPropertyMap properties, | 26 const char *ExtractString(const DBusPropertyMap properties, |
27 const char *key, | 27 const char *key, |
28 const char *not_found_response, | 28 const char *not_found_response, |
29 DBus::Error &error); | 29 DBus::Error &error); |
30 | 30 |
| 31 // Extracts the key from proprties, returning not_found_response if |
| 32 // the key is not found. If key is found, but is not a Uint32, sets |
| 33 // error and returns not_found_response. If error.is_set() is true, |
| 34 // ExtractUint32 will not report further errors. You can make |
| 35 // multiple ExtractUint32 calls and check error at the end. |
| 36 uint32_t ExtractUint32(const DBusPropertyMap properties, |
| 37 const char *key, |
| 38 uint32_t not_found_response, |
| 39 DBus::Error &error); |
| 40 |
| 41 |
31 // Convert a string representing a hex ESN to one representing a | 42 // Convert a string representing a hex ESN to one representing a |
32 // decimal ESN. Returns success. | 43 // decimal ESN. Returns success. |
33 bool HexEsnToDecimal(const std::string &esn_hex, std::string *out); | 44 bool HexEsnToDecimal(const std::string &esn_hex, std::string *out); |
34 | 45 |
35 } // namespace utilities | 46 } // namespace utilities |
36 | 47 |
37 #endif /* CROMO_UTILITIES_H_ */ | 48 #endif /* CROMO_UTILITIES_H_ */ |
OLD | NEW |