equal
deleted
inserted
replaced
59 /** |
59 /** |
60 Check whether two CProcessPair objects are equal |
60 Check whether two CProcessPair objects are equal |
61 |
61 |
62 @param aProcessPair a CProcessPair object to match with this one |
62 @param aProcessPair a CProcessPair object to match with this one |
63 |
63 |
64 @return ETrue is process id and name match, EFalse otherwise |
64 @return 0 if process ids and names do not match, non-zero if they do |
65 */ |
65 */ |
66 TBool CProcessPair::operator==(const CProcessPair &aProcessPair) const |
66 TBool CProcessPair::operator==(const CProcessPair &aProcessPair) const |
67 { |
67 { |
68 return Equals(*aProcessPair.iProcessName, aProcessPair.iProcessId); |
68 return Equals(*aProcessPair.iProcessName, aProcessPair.iProcessId); |
69 } |
69 } |
72 Check whether this CProcessPair object has these values set |
72 Check whether this CProcessPair object has these values set |
73 |
73 |
74 @param aProcessName process name to check |
74 @param aProcessName process name to check |
75 @param aProcessId process id to check |
75 @param aProcessId process id to check |
76 |
76 |
77 @return ETrue is process id and name match, EFalse otherwise |
77 @return 0 if process ids and names do not match, non-zero if they do |
78 */ |
78 */ |
79 TBool CProcessPair::Equals(const TDesC& aProcessName, const TProcessId aProcessId) const |
79 TBool CProcessPair::Equals(const TDesC& aProcessName, const TProcessId aProcessId) const |
80 { |
80 { |
81 return (ProcessIdMatches(aProcessId) && (ProcessNameMatches(aProcessName))); |
81 return (ProcessIdMatches(aProcessId) && (ProcessNameMatches(aProcessName))); |
82 } |
82 } |
84 /** |
84 /** |
85 Check whether the process ids of two objects match |
85 Check whether the process ids of two objects match |
86 |
86 |
87 @param aProcessPair a CProcessPair object to compare with this one |
87 @param aProcessPair a CProcessPair object to compare with this one |
88 |
88 |
89 @return ETrue is process id matches, EFalse otherwise |
89 @return 0 if process ids do not match, non-zero if they do |
90 */ |
90 */ |
91 TBool CProcessPair::ProcessIdMatches(const CProcessPair &aProcessPair) const |
91 TBool CProcessPair::ProcessIdMatches(const CProcessPair &aProcessPair) const |
92 { |
92 { |
93 return ProcessIdMatches(aProcessPair.iProcessId); |
93 return ProcessIdMatches(aProcessPair.iProcessId); |
94 } |
94 } |
96 /** |
96 /** |
97 Check whether two process ids match |
97 Check whether two process ids match |
98 |
98 |
99 @param aProcessId a process ID to compare with this pair's process ID |
99 @param aProcessId a process ID to compare with this pair's process ID |
100 |
100 |
101 @return ETrue is process id matches, EFalse otherwise |
101 @return 0 if process ids do not match, non-zero if they do |
102 */ |
102 */ |
103 TBool CProcessPair::ProcessIdMatches(const TProcessId &aProcessId) const |
103 TBool CProcessPair::ProcessIdMatches(const TProcessId &aProcessId) const |
104 { |
104 { |
105 return iProcessId == aProcessId; |
105 return iProcessId == aProcessId; |
106 } |
106 } |
108 /** |
108 /** |
109 Check whether the process names of two objects match in-case-sensitively |
109 Check whether the process names of two objects match in-case-sensitively |
110 |
110 |
111 @param aProcessPair a CProcessPair object to compare with this one |
111 @param aProcessPair a CProcessPair object to compare with this one |
112 |
112 |
113 @return ETrue is process names match, EFalse otherwise |
113 @return 0 if process names do not match, non-zero if they do |
114 */ |
114 */ |
115 TBool CProcessPair::ProcessNameMatches(const CProcessPair &aProcessPair) const |
115 TBool CProcessPair::ProcessNameMatches(const CProcessPair &aProcessPair) const |
116 { |
116 { |
117 return ProcessNameMatches(*aProcessPair.iProcessName); |
117 return ProcessNameMatches(*aProcessPair.iProcessName); |
118 } |
118 } |
120 /** |
120 /** |
121 Check whether two strings match in-case-sensitively |
121 Check whether two strings match in-case-sensitively |
122 |
122 |
123 @param aProcessName a process name to compare with this pair's process name |
123 @param aProcessName a process name to compare with this pair's process name |
124 |
124 |
125 @return ETrue is process names match, EFalse otherwise |
125 @return 0 if process names do not match, non-zero if they do |
126 */ |
126 */ |
127 TBool CProcessPair::ProcessNameMatches(const TDesC& aProcessName) const |
127 TBool CProcessPair::ProcessNameMatches(const TDesC& aProcessName) const |
128 { |
128 { |
129 TInt equal = iProcessName->CompareF(aProcessName); |
129 return iProcessName->CompareF(aProcessName) == 0; |
130 return (equal == 0) ? ETrue : EFalse; |
|
131 } |
130 } |
132 |
131 |