2 |
|
// |
3 |
|
// Douglas Thrift |
4 |
|
// |
5 |
< |
// $Id: IndividualClient.h,v 1.5 2003/08/20 05:49:34 douglas Exp $ |
5 |
> |
// $Id: IndividualClient.h,v 1.6 2003/09/02 06:05:56 douglas Exp $ |
6 |
|
|
7 |
|
#ifndef _IndividualClient_h_ |
8 |
|
#define _IndividualClient_h_ |
23 |
|
void capitalize(string& word, unsigned index = 0, unsigned count = 1); |
24 |
|
public: |
25 |
|
IndividualClient() { number = 0; } |
26 |
+ |
IndividualClient(unsigned number, const string& name); |
27 |
+ |
IndividualClient(const string& file); |
28 |
|
~IndividualClient() {} |
29 |
|
unsigned getNumber(void); |
30 |
|
string getName(void); |
35 |
|
void setFile(const string& file); |
36 |
|
static void setExtension(const string& extension) { |
37 |
|
IndividualClient::extension = extension; } |
38 |
+ |
bool operator<(const IndividualClient& data) const; |
39 |
+ |
bool operator>(const IndividualClient& data) const; |
40 |
|
}; |
41 |
|
|
42 |
+ |
inline bool mcLess(const string& first, const string& second) |
43 |
+ |
{ |
44 |
+ |
if (first.find('M') == 0 && second.find('M') == 0) |
45 |
+ |
{ |
46 |
+ |
if (first.find("Mc") == 0 && second.find("Mc") != 0) |
47 |
+ |
{ |
48 |
+ |
return true; |
49 |
+ |
} |
50 |
+ |
else if (first.find("Mc") != 0 && second.find("Mc") == 0) |
51 |
+ |
{ |
52 |
+ |
return false; |
53 |
+ |
} |
54 |
+ |
} |
55 |
+ |
|
56 |
+ |
return first < second; |
57 |
+ |
} |
58 |
+ |
inline bool mcGreater(const string& first, const string& second) |
59 |
+ |
{ |
60 |
+ |
if (first.find('M') == 0 && second.find('M') == 0) |
61 |
+ |
{ |
62 |
+ |
if (first.find("Mc") == 0 && second.find("Mc") != 0) |
63 |
+ |
{ |
64 |
+ |
return false; |
65 |
+ |
} |
66 |
+ |
else if (first.find("Mc") != 0 && second.find("Mc") == 0) |
67 |
+ |
{ |
68 |
+ |
return true; |
69 |
+ |
} |
70 |
+ |
} |
71 |
+ |
|
72 |
+ |
return first > second; |
73 |
+ |
} |
74 |
+ |
|
75 |
|
#endif // _IndividualClient_h_ |