ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/VTBFileUtil2/IndividualClient.cxx
(Generate patch)

Comparing trunk/VTBFileUtil2/IndividualClient.cxx (file contents):
Revision 265 by douglas, 2003-08-16T20:55:39-07:00 vs.
Revision 266 by douglas, 2003-08-17T16:39:32-07:00

# Line 2 | Line 2
2   //
3   // Douglas Thrift
4   //
5 < // $Id: IndividualClient.cxx,v 1.2 2003/08/17 03:55:39 douglas Exp $
5 > // $Id: IndividualClient.cxx,v 1.3 2003/08/17 23:39:32 douglas Exp $
6  
7   #include "IndividualClient.h"
8  
# Line 79 | Line 79 | void IndividualClient::demunge(void)
79          file.get();
80  
81          ostringstream name;
82 <        unsigned count = 0;
82 >        unsigned count = 1;
83  
84          do
85          {
# Line 88 | Line 88 | void IndividualClient::demunge(void)
88                  file >> word;
89                  file.get();
90  
91 <                if (word.length() == 1) word += '.';
92 <
93 <                if (word.length() > 2 && word.find("mc") == 0)
91 >                if (word.length() == 1 || word == "jr" || word == "sr")
92 >                {
93 >                        word += '.';
94 >                }
95 >                else if (word == "de" && count == 1)
96 >                {
97 >                        --count;
98 >                }
99 >                else if (word == "ii" || word == "iv" || word == "iv")
100 >                {
101 >                        capitalize(word += '.', 0, 2);
102 >                }
103 >                else if (word == "iii")
104 >                {
105 >                        capitalize(word += '.', 0, 3);
106 >                }
107 >                else if (word.length() > 2 && word.find("mc") == 0)
108                  {
109                          capitalize(word, 2);
110                  }
# Line 108 | Line 122 | void IndividualClient::demunge(void)
122                  switch (++count)
123                  {
124                  case 1:
125 <                        name << word;
125 >                        name << word << " ";
126                          break;
127                  case 2:
128 +                        name << word;
129 +                        break;
130 +                case 3:
131                          name << ", " << word;
132                          break;
133                  default:
# Line 141 | Line 158 | string IndividualClient::demunge(const s
158  
159          return demunged;
160   }
161 +
162 + void IndividualClient::capitalize(string& word, unsigned index, unsigned count)
163 + {
164 +        for (unsigned number = index; number < index + count; number++)
165 +        {
166 +                word[number] = toupper(word[number]);
167 +        }
168 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines