ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/VTBFileUtil2/IndividualClient.h
Revision: 285
Committed: 2003-09-02T20:40:35-07:00 (19 years, 1 month ago) by douglas
Content type: text/x-c
Original Path: trunk/VTBFileUtil2/IndividualClient.h
File size: 1815 byte(s)
Log Message:
The world turns.

File Contents

# User Rev Content
1 douglas 260 // Vance Thrift and Biller File Utility 2
2     //
3     // Douglas Thrift
4     //
5 douglas 285 // $Id: IndividualClient.h,v 1.7 2003/09/03 03:40:35 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 285 void lowercase(string& word) { word = toLower(word); }
20 douglas 265 void demunge(void);
21     string demunge(const string& munged);
22 douglas 266 void capitalize(string& word, unsigned index = 0, unsigned count = 1);
23 douglas 260 public:
24 douglas 265 IndividualClient() { number = 0; }
25 douglas 284 IndividualClient(unsigned number, const string& name);
26     IndividualClient(const string& file);
27 douglas 265 ~IndividualClient() {}
28     unsigned getNumber(void);
29     string getName(void);
30     string getFile(void);
31 douglas 271 static string getExtension(void) { return extension; }
32 douglas 265 void setNumber(unsigned number);
33     void setName(const string& name);
34     void setFile(const string& file);
35 douglas 271 static void setExtension(const string& extension) {
36     IndividualClient::extension = extension; }
37 douglas 284 bool operator<(const IndividualClient& data) const;
38     bool operator>(const IndividualClient& data) const;
39 douglas 260 };
40    
41 douglas 284 inline bool mcLess(const string& first, const string& second)
42     {
43     if (first.find('M') == 0 && second.find('M') == 0)
44     {
45     if (first.find("Mc") == 0 && second.find("Mc") != 0)
46     {
47     return true;
48     }
49     else if (first.find("Mc") != 0 && second.find("Mc") == 0)
50     {
51     return false;
52     }
53     }
54    
55 douglas 285 return toLower(first) < toLower(second);
56 douglas 284 }
57     inline bool mcGreater(const string& first, const string& second)
58     {
59     if (first.find('M') == 0 && second.find('M') == 0)
60     {
61     if (first.find("Mc") == 0 && second.find("Mc") != 0)
62     {
63     return false;
64     }
65     else if (first.find("Mc") != 0 && second.find("Mc") == 0)
66     {
67     return true;
68     }
69     }
70    
71 douglas 285 return toLower(first) > toLower(second);
72 douglas 284 }
73    
74 douglas 260 #endif // _IndividualClient_h_