Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Find property name before the first semi-colon in ProcessTextVectors.
[xestiacalendar/.git] / source / common / text.cpp
1 #include "text.h"
3 using namespace std;
5 multimap<string, string> ProcessTextVectors(vector<string> *TextProperties,
6         vector<string> *TextValues,
7         bool SearchMultiple,
8         string Property){
9         
10         multimap<string,string> ProcessResult;
11                 
12         // Go through each of the values.
13                 
14         int TextSeekCount = 0;
15         int TextPropertySize = 0;
16         int PropertySeekCount = 0;
17         string PropertyName = "";
18         int PropertyNameSize = 0;
19         char BufferChar = 0;
20                 
21         for (vector<string>::iterator iter = TextProperties->begin();
22                 iter != TextProperties->end(); iter++){
23                 
24                 TextPropertySize = iter->size();
25                         
26                 if (TextPropertySize == 0){
27                         
28                         // Text property size is 0. Go to the next
29                         // pair.
30                         
31                         continue;
32                         
33                 }
34                         
35                 // Get the property data up to the first semi-colon.
36                 
37                 while (TextSeekCount < TextPropertySize){
38                 
39                         BufferChar = (*iter)[TextSeekCount];
40                         
41                         if (BufferChar == ';'){
42                                 break;
43                         }
44                         
45                         PropertyName += BufferChar;
46                         
47                         TextSeekCount++;
48                         
49                 }
50                 
51                 if (*iter == Property || PropertyName == Property){
52                         
53                         ProcessResult.insert(make_pair((*TextProperties)[PropertySeekCount], 
54                                 (*TextValues)[PropertySeekCount]));
55                         
56                 }
57                         
58                 PropertySeekCount++;
59                 TextPropertySize = 0;
60                 TextSeekCount = 0;
61                 PropertyName.clear();
62                         
63         }
64                 
65         return ProcessResult;
66                 
67 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy