Changeset 292 for AE/Installer/trunk/source/subs.cpp
- Timestamp:
- Apr 4, 2009, 10:13:56 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/subs.cpp
r290 r292 9 9 #include "methods.h" 10 10 #include <vector> 11 #include <fstream> 11 12 12 13 #include <errno.h> … … 38 39 packages.reserve(256); //thats 63 or 64 pointers to packages...i think. :P Reserving this improves performance when we add new pointers 39 40 41 fstream file; 42 40 43 #ifdef WIN32 41 44 string path = "K:\\Oni\\edition\\install\\packages"; //only for my build. :P … … 46 49 string filename = "\0"; 47 50 string MODINFO_CFG = "\\Mod_Info.cfg"; 51 52 string line; 53 48 54 DIR *pdir; 49 55 struct dirent *pent; … … 54 60 exit(1); 55 61 } 56 errno=0; 57 while ((pent=readdir(pdir))){ 58 62 errno=0; 63 64 while (( pent = readdir(pdir) )){ 59 65 60 66 filename = path + '\\' + pent->d_name + MODINFO_CFG; 61 67 file.open(filename.c_str()); 68 62 69 //cout << filename << "\n"; 63 70 64 if (FILE * file = fopen( filename.c_str(), "r"))71 if(!file.fail() ) 65 72 { 73 //file.open(filename.c_str(), fstream::out); 74 66 75 //do stuff like adding to vector :P 76 cout << pent->d_name << "\n"; 77 while (! file.eof() ) 78 { 79 getline (file,line); 80 cout << line << endl; 81 } 82 //would prefer to push a pointer to a package, but this will do for now 83 //packages.push_back( fileToModPackage(file) ); 67 84 68 cout << pent->d_name << "\n"; 69 70 //would prefer to push a pointer to a package, but this will do for now 71 //packages.push_back(modelfileToModPackage(file *)) 72 fclose(file); 73 } 74 85 } 86 file.close(); 87 file.clear(); 88 75 89 } 76 90 … … 84 98 85 99 return packages; 100 } 101 102 ModPackage fileToModPackage(fstream file) { 103 ModPackage package; 104 cout << file; 105 return package; 86 106 } 87 107
Note:
See TracChangeset
for help on using the changeset viewer.