Changeset 6216
- Timestamp:
- Mar 29, 2016, 8:52:47 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/idatatest.cpp
r5895 r6216 2 2 #include <cstdlib> 3 3 #include <iostream> 4 #include <sstream> 4 5 #include <fstream> 5 6 … … 22 23 } 23 24 25 int collection = 3; 26 if (argc > 1) { 27 collection = atoi(argv[1]); 28 } 29 24 30 std::cout << std::endl << std::endl; 25 31 std::vector<DirectoryItem> dir; 26 getContents( 3, "", dir);32 getContents(collection, "", dir); 27 33 std::cout << std::endl << std::endl; 28 34 for (std::vector<DirectoryItem>::iterator itr = dir.begin(); … … 37 43 38 44 std::cout << std::endl << std::endl; 45 const char *filename = NULL; 46 if (argc > 2) { 47 filename = argv[2]; 48 } else if (collection == 3) { 49 filename = "station.csv"; 50 } else { 51 iDataCleanup(); 52 return 0; 53 } 54 55 std::ostringstream oss; 56 oss << "//" << filename; 39 57 Buffer buff; 40 getFile( 3, "//station.csv", &buff);58 getFile(collection, oss.str().c_str(), &buff); 41 59 std::cout << std::endl << std::endl; 42 std::cout << "station.csvsize: " << buff.size << std::endl;43 std::ofstream file( "station.csv");60 std::cout << filename << " size: " << buff.size << std::endl; 61 std::ofstream file(filename); 44 62 file.write((char *)buff.data, buff.size); 45 63 file.close();
Note: See TracChangeset
for help on using the changeset viewer.