#include #include #include #include std::map fileToPackage; std::map packageToFile; std::vector headers; std::vector sources; std::vector examples; std::vector all; int main(){ std::vector packages = tok("ICLCore ICLCV ICLFilter ICLGeom ICLIO ICLMarkers ICLMath ICLQt ICLUtils"," "); int N = packages.size(); std::cout << "analyzing ..." << std::endl; fileToPackage["RSBImage.pb.h"] = "ICLIO"; packageToFile["ICLIO"] = "RSBImage.pb.h"; for(int i=0;i 13 && l.substr(0,13) == "#include ",3); std::cout << " " << "--" << r.submatches[1] << "--" << r.submatches[2] << std::endl; std::string ifile = r.submatches[2]+".h"; std::string targetPackage = fileToPackage[ifile]; std::string curretPackage = "ICL"+r.submatches[1]; if(targetPackage != curretPackage){ std::string newLine = "#include <"+targetPackage+"/"+ifile+">"; std::cout << "found: " << l << " replacing by: " << newLine << std::endl; f2.write(newLine + "\n"); }else{ f2.write(l + "\n"); } }else{ f2.write(l + "\n"); } } std::cout << "system: --" << ("mv "+fn2+" "+fn).c_str() << "--" << std::endl; system(("mv "+fn2+" "+fn).c_str()); } }