20 m_ullFileVer = StrToVerA(strVal,','); 221 } 222 else if (ParseVersionInfo(strLine,"PRODUCTVERSION",strVal)!=string::npos) 223 { 224 m_ullProductVer = StrToVerA(strVal,','); 225 } 226 else if (ParseBlockInfo(strLine,"VALUE \"CompanyName\"",strVal)!=string::npos) 227 { 228 astr2tstr(strVal.c_str(),m_tstrCompanyName); 229 } 230 else if (ParseBlockInfo(strLine,"VALUE \"FileDescription\"",strVal)!=string::npos) 231 { 232 astr2tstr(strVal.c_str(),m_tstrFileDesc); 233 } 234 else if (ParseBlockInfo(strLine,"VALUE \"FileVersion\"",strVal)!=string::npos) 235 { 236 m_ullOtherFileVer = StrToVerA(strVal); 237 } 238 else if (ParseBlockInfo(strLine,"VALUE \"InternalName\"",strVal)!=string::npos) 239 { 240 astr2tstr(strVal.c_str(),m_tstrInternalName); 241 } 242 else if (ParseBlockInfo(strLine,"VALUE \"LegalCopyright\"",strVal)!=string::npos) 243 { 244 astr2tstr(strVal.c_str(),m_tstrCopyright); 245 } 246 else if (ParseBlockInfo(strLine,"VALUE \"OriginalFilename\"",strVal)!=string::npos) 247 { 248 astr2tstr(strVal.c_str(),m_tstrOriginalFileName); 249 } 250 else if (ParseBlockInfo(strLine,"VALUE \"ProductName\"",strVal)!=string::npos) 251 { 252 astr2tstr(strVal.c_str(),m_tstrProductName); 253 } 254 else if (ParseBlockInfo(strLine,"VALUE \"ProductVersion\"",strVal)!=string::npos) 255 { 256 m_ullOtherProductVer = StrToVerA(strVal); 257 } 258} 259 260size_t CRCVersion::ParseVersionInfo(const string& strLine,const string& strType,string& strVal) 261{ 262 size_t pos = strLine.find(strType); 263 if (pos == string::npos) 264 { 265 return string::npos; 266 } 267 pos += strType.length(); 268 pos = strLine.find(',',pos); 269 if (pos == string::npos) 270 { 271 return string::npos; 272 } 273 size_t pos3 = pos; 274 size_t pos1 = strLine.rfind(' ',pos); 275 size_t pos2 = strLine.rfind('\t',pos); 276 if (pos1 == string::npos && pos2 == string::npos) 277 { 278 return string::npos; 279 } 280 else if (pos1 == string::npos || pos2 == string::npos) 281 { 282 pos = min(pos1, pos2); 283 } 284 else 285 { 286 pos = max(pos1, pos2); 287 } 288 pos2 = ++pos; 289 pos = strLine.find(',', ++pos3); 290 if (pos == string::npos) 291 { 292 return string::npos; 293 } 294 pos = strLine.find(',',++pos); 295 if (pos == string::npos) 296 { 297 return string::npos; 298 } 299 pos1 = ++pos; 300 pos = strLine.find(' ',pos1); 301 if (pos == string::npos) 302 { 303 pos = strLine.find('\t',pos1); 304 } 305 if (pos == string::npos) 306 { 307 pos = strLine.find('\r',pos1); 308 } 309 if (pos == string::npos) 310 { 311 pos = strLine.find('\n',pos1); 312 } 313 if (pos == string::npos) 314 { 315 return string::npos; 316 } 317 strVal = strLine.substr(pos2,pos-pos2); 318 return pos2; 319} 320 321size_t CRCVersion::ParseBlockInfo(const string& strLine,const string& strType,string& strVal) 322{ 323 size_t pos = strLine.find(strType); 324 if (pos == string::npos) 325 { 326 return string::npos; 327 } 328 pos += strType.length(); 329 pos = strLine.find(',',pos); 330 if (pos == string: |