- Timestamp:
- 2012-03-16T21:38:01+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/corba/corbatext_t.mpp
r15463 r25231 85 85 ct->encoding = 0; 86 86 cout << "C" << endl; 87 88 return 0; 87 89 } 88 90 … … 178 180 } 179 181 182 183 // map of metanames to array(lang, value). So each metaname[i] maps to array (lang, value). 184 // Note that corbacollectionmeta_map is an array of pairs 185 // each pair consists of (string, map) 186 void corbatext_colmetamapToCorbaColmetamap(collectionmeta_map cm, corbatext_tcollectionmeta_map *ccm) 187 { 188 collectionmeta_map::iterator here = cm.begin(); 189 collectionmeta_map::iterator end = cm.end(); 190 unsigned int i = 0; 191 192 while (here != end) 193 { 194 ccm->length(i+1); // increase size of array of (name, tuples) pairs by 1 each time 195 196 // fill in the metaname field 197 // metaname is of type text_t, get the corbatext value for the text_t key 198 (*ccm)[i].name = *corbatext_corbatext((*here).first); // metaname is of type text_t 199 200 // fill in the tuples field 201 corbatext_mapToCorbaMap((*here).second, &((*ccm)[i].tuples)); 202 203 here ++; 204 i ++; 205 } 206 207 } 208 209 void corbatext_corbaColmetamapToColmetamap(corbatext_tcollectionmeta_map ccm, collectionmeta_map &cm) 210 { 211 unsigned int i; 212 213 for (i = 0; i < ccm.length(); i ++) 214 { 215 // ccm is an array 216 // where each element is a pair of (name, tuples) 217 218 // 1. get the (corba_text_t) name and convert it to text_t 219 text_t* meta_name = new corbaconv_text_t(ccm[i].name); 220 221 corbatext_tmap corbameta_tuples = ccm[i].tuples; 222 223 text_tmap *tuples_map = new text_tmap(); 224 corbatext_corbaMapToMap(ccm[i].tuples, *tuples_map); 225 226 227 cm.insert(make_pair(*meta_name, 228 *tuples_map)); 229 } 230 } 231
Note:
See TracChangeset
for help on using the changeset viewer.