Changeset 2306
- Timestamp:
- 03/09/10 13:44:09 (5 months ago)
- Location:
- FalconView/trunk/public/fvw_core/GeodataDataSources
- Files:
-
- 3 modified
-
KMLNetworkLinkResource.cpp (modified) (1 diff)
-
LibkmlDataSource.cpp (modified) (1 diff)
-
LibkmlDataSource.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FalconView/trunk/public/fvw_core/GeodataDataSources/KMLNetworkLinkResource.cpp
r2286 r2306 21 21 WriteToLogFile(_bstr_t(msg.c_str())); 22 22 } 23 24 CLibkmlDataSource::MaybeDumpKML(kml_data); 23 25 24 26 std::string errors; -
FalconView/trunk/public/fvw_core/GeodataDataSources/LibkmlDataSource.cpp
r2279 r2306 591 591 if (s_dumpFile.length() > 0) 592 592 { 593 // dump kml to a file 594 std::ofstream f(s_dumpFile.c_str(), std::ios::app); 595 f << kml << "\n\n********\n\n"; 596 f.close(); 593 std::string todump = kml; 594 595 // if this is KMZ, unpack it 596 if (kmlengine::KmzFile::IsKmz(kml)) 597 { 598 kmlengine::KmzFilePtr kmz_file = kmlengine::KmzFile::OpenFromString(kml); 599 ASSERT(kmz_file); 600 bool b = kmz_file->ReadKml(&todump); 601 ASSERT(b); 602 } 603 604 // make sure only one person writing to the file at a time 605 HANDLE h = ::CreateMutexW(NULL, false, L"MaybeDumpKMLSem"); 606 if (h == NULL) 607 { 608 //DWORD rc = GetLastError(); 609 ASSERT(0); 610 } 611 DWORD d = ::WaitForSingleObject(h, INFINITE); 612 _ASSERT(d == WAIT_OBJECT_0); 613 614 try 615 { 616 // dump kml to a file 617 std::ofstream f(s_dumpFile.c_str(), std::ios::app); 618 f << todump << "\n\n********\n\n"; 619 f.close(); 620 } 621 catch (...) { } // rare exception to rule about ignoring exceptions 622 623 // release mutex 624 ::ReleaseMutex(h); 625 ::CloseHandle(h); 597 626 } 598 627 } -
FalconView/trunk/public/fvw_core/GeodataDataSources/LibkmlDataSource.h
r2279 r2306 130 130 static kmldom::GeometryPtr WrapGeometryInGeometry(IGeometry* geometry, kmldom::KmlFactory* factory); 131 131 static kmldom::PlacemarkPtr WrapFeatureInPlacemark(IFeature* feature, kmldom::KmlFactory* factory); 132 static void MaybeDumpKML(std::string& kml); 132 133 133 134 static void FireDataSourceChanged(LONG sourceHandle); … … 219 220 static BOOL s_bEnvironmentTested; 220 221 static std::string s_dumpFile; 221 static void MaybeDumpKML(std::string& kml);222 222 }; 223 223
