ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/VTBFileUtil2/IndividualClient.h
Revision: 284
Committed: 2003-09-01T23:05:56-07:00 (19 years, 1 month ago) by douglas
Content type: text/x-c
Original Path: trunk/VTBFileUtil2/IndividualClient.h
File size: 1852 byte(s)
Log Message:
Did stuff, fixed errors.

File Contents

# User Rev Content
1 douglas 260 // Vance Thrift and Biller File Utility 2
2     //
3     // Douglas Thrift
4     //
5 douglas 284 // $Id: IndividualClient.h,v 1.6 2003/09/02 06:05:56 douglas Exp $
6 douglas 260
7     #ifndef _IndividualClient_h_
8     #define _IndividualClient_h_
9    
10 douglas 265 #include "VTBFileUtil2.h"
11 douglas 260
12     class IndividualClient
13     {
14     private:
15 douglas 265 unsigned number;
16     string name;
17     string file;
18 douglas 271 static string extension;
19 douglas 267 void lowercase(string& word) { for (unsigned index = 0; index <
20     word.length(); index++) word[index] = tolower(word[index]); }
21 douglas 265 void demunge(void);
22     string demunge(const string& munged);
23 douglas 266 void capitalize(string& word, unsigned index = 0, unsigned count = 1);
24 douglas 260 public:
25 douglas 265 IndividualClient() { number = 0; }
26 douglas 284 IndividualClient(unsigned number, const string& name);
27     IndividualClient(const string& file);
28 douglas 265 ~IndividualClient() {}
29     unsigned getNumber(void);
30     string getName(void);
31     string getFile(void);
32 douglas 271 static string getExtension(void) { return extension; }
33 douglas 265 void setNumber(unsigned number);
34     void setName(const string& name);
35     void setFile(const string& file);
36 douglas 271 static void setExtension(const string& extension) {
37     IndividualClient::extension = extension; }
38 douglas 284 bool operator<(const IndividualClient& data) const;
39     bool operator>(const IndividualClient& data) const;
40 douglas 260 };
41    
42 douglas 284 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 douglas 260 #endif // _IndividualClient_h_