|
1 /* |
|
2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Simple utility functions for core |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 5 % |
|
20 */ |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 /** |
|
25 * operator== for core_mac_address_s |
|
26 * @param lhs left hand side |
|
27 * @param rhs right hand side |
|
28 * @return true_t if equal, false_t otherwise |
|
29 */ |
|
30 inline bool_t operator== ( |
|
31 const core_mac_address_s& lhs, |
|
32 const core_mac_address_s& rhs ) |
|
33 { |
|
34 if ( !core_tools_c::compare( lhs.addr, MAC_ADDR_LEN, |
|
35 rhs.addr, MAC_ADDR_LEN ) ) |
|
36 { |
|
37 return true_t; |
|
38 } |
|
39 |
|
40 return false_t; |
|
41 } |
|
42 |
|
43 /** |
|
44 * operator!= for core_mac_address_s |
|
45 * @param lhs left hand side |
|
46 * @param rhs right hand side |
|
47 * @return true_t if not equal, false_t otherwise |
|
48 */ |
|
49 inline bool_t operator!= ( |
|
50 const core_mac_address_s& lhs, |
|
51 const core_mac_address_s& rhs ) |
|
52 { |
|
53 return !( lhs == rhs ); |
|
54 } |
|
55 |
|
56 /** |
|
57 * operator== for core_ssid_s |
|
58 * @param lhs left hand side |
|
59 * @param rhs right hand side |
|
60 * @return true_t if equal, false_t otherwise |
|
61 */ |
|
62 inline bool_t operator== ( |
|
63 const core_ssid_s& lhs, |
|
64 const core_ssid_s& rhs ) |
|
65 { |
|
66 if ( !core_tools_c::compare( lhs.ssid, lhs.length, |
|
67 rhs.ssid, rhs.length ) ) |
|
68 { |
|
69 return true_t; |
|
70 } |
|
71 |
|
72 return false_t; |
|
73 } |
|
74 |
|
75 /** |
|
76 * operator!= for core_ssid_s |
|
77 * @param lhs left hand side |
|
78 * @param rhs right hand side |
|
79 * @return true_t if not equal, false_t otherwise |
|
80 */ |
|
81 inline bool_t operator!= ( |
|
82 const core_ssid_s& lhs, |
|
83 const core_ssid_s& rhs ) |
|
84 { |
|
85 return !( lhs == rhs ); |
|
86 } |
|
87 |
|
88 /** |
|
89 * operator== for core_country_string_s |
|
90 * @param lhs left hand side |
|
91 * @param rhs right hand side |
|
92 * @return true_t equal, false_t otherwise |
|
93 */ |
|
94 inline bool_t operator== ( |
|
95 const core_country_string_s& lhs, |
|
96 const core_country_string_s& rhs ) |
|
97 { |
|
98 if ( !core_tools_c::compare( lhs.country, MAX_COUNTRY_STRING_LENGTH, |
|
99 rhs.country, MAX_COUNTRY_STRING_LENGTH ) ) |
|
100 { |
|
101 return true_t; |
|
102 } |
|
103 |
|
104 return false_t; |
|
105 } |
|
106 |
|
107 /** |
|
108 * operator!= for core_country_string_s |
|
109 * @param lhs left hand side |
|
110 * @param rhs right hand side |
|
111 * @return true_t if not equal, false_t otherwise |
|
112 */ |
|
113 inline bool_t operator!= ( |
|
114 const core_country_string_s& lhs, |
|
115 const core_country_string_s& rhs ) |
|
116 { |
|
117 return !( lhs == rhs ); |
|
118 } |
|
119 |
|
120 /** |
|
121 * operator== for medium_time_s |
|
122 * @param lhs left hand side |
|
123 * @param rhs right hand side |
|
124 * @return true_t if not equal, false_t otherwise |
|
125 */ |
|
126 inline bool_t operator== ( |
|
127 const medium_time_s& lhs, |
|
128 const medium_time_s& rhs ) |
|
129 { |
|
130 if( !core_tools_c::compare( |
|
131 reinterpret_cast<const u8_t*>( lhs.up ), sizeof( lhs.up ), |
|
132 reinterpret_cast<const u8_t*>( rhs.up ), sizeof( rhs.up ) ) && |
|
133 !core_tools_c::compare( |
|
134 reinterpret_cast<const u8_t*>( lhs.ac ), sizeof( lhs.ac ), |
|
135 reinterpret_cast<const u8_t*>( rhs.ac ), sizeof( rhs.ac ) ) ) |
|
136 { |
|
137 return true_t; |
|
138 } |
|
139 |
|
140 return false_t; |
|
141 } |
|
142 |
|
143 /** |
|
144 * operator!= for medium_time_s |
|
145 * @param lhs left hand side |
|
146 * @param rhs right hand side |
|
147 * @return true_t if not equal, false_t otherwise |
|
148 */ |
|
149 inline bool_t operator!= ( |
|
150 const medium_time_s& lhs, |
|
151 const medium_time_s& rhs ) |
|
152 { |
|
153 return !( lhs == rhs ); |
|
154 } |