@@ -11,9 +11,9 @@ bool visualStudioProject::createProjectFile(){
1111// alert("visualStudioProject::createProjectFile");
1212
1313 solution = projectDir / (projectName + " .sln" );
14- fs::path project = projectDir / (projectName + " .vcxproj" );
15- fs::path user = projectDir / (projectName + " .vcxproj.user" );
16- fs::path filters = projectDir / (projectName + " .vcxproj.filters" );
14+ fs::path project { projectDir / (projectName + " .vcxproj" ) } ;
15+ fs::path user { projectDir / (projectName + " .vcxproj.user" ) } ;
16+ fs::path filters { projectDir / (projectName + " .vcxproj.filters" ) } ;
1717
1818 fs::copy (templatePath / " emptyExample.vcxproj" , project, fs::copy_options::overwrite_existing);
1919 fs::copy (templatePath / " emptyExample.vcxproj.user" , user, fs::copy_options::overwrite_existing);
@@ -35,8 +35,8 @@ bool visualStudioProject::createProjectFile(){
3535
3636
3737 if (!fs::equivalent (getOFRoot (), fs::path{ " ../../.." })) {
38- string root = getOFRoot ().string () ;
39- string relRootWindows = convertStringToWindowsSeparator (root) + " \\ " ;
38+ string root { getOFRoot ().string () } ;
39+ string relRootWindows { convertStringToWindowsSeparator (root) + " \\ " } ;
4040
4141 // sln has windows paths:
4242// alert ("replacing root with " + relRootWindows, 36);
@@ -59,8 +59,8 @@ bool visualStudioProject::loadProjectFile(){
5959 ofLogError (LOG_NAME) << " error loading " << projectPath << " doesn't exist" ;
6060 return false ;
6161 }
62- pugi::xml_parse_result result = doc.load_file (projectPath.c_str ());
63- bLoaded = result.status == pugi::status_ok;
62+ pugi::xml_parse_result result { doc.load_file (projectPath.c_str ()) } ;
63+ bLoaded = result.status == pugi::status_ok;
6464// alert ("visualStudioProject::loadProjectFile() " + projectPath.string() + " : " + ofToString(bLoaded));
6565 return bLoaded;
6666}
@@ -75,10 +75,10 @@ bool visualStudioProject::saveProjectFile(){
7575 add one entry for each additional, fixing slashes, generating new uuid.
7676 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}"
7777 EndProject
78- */
78+ */
7979 if (!additionalvcxproj.empty ()) {
8080 string additionalProjects;
81- // string divider = "\r\n";
81+ // string divider = "\r\n";
8282 string divider = " \n " ;
8383 for (auto & a : additionalvcxproj) {
8484 string name = a.filename ().stem ().string ();
@@ -89,42 +89,42 @@ bool visualStudioProject::saveProjectFile(){
8989 " Project(\" {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\" ) = \" " +name+" \" , \" " +aString+" \" , \" {" +uuid+" }\" " +
9090 divider + " EndProject" + divider;
9191 }
92- // string findString = "Global" + divider;
92+ // string findString = "Global" + divider;
9393 string findString = " Global" ;
9494
9595 additionalProjects += findString ;
9696
9797 solution = solution.lexically_normal ();
98- // findandreplaceInTexfile(solution, findString, additionalProjects);
99-
98+ // findandreplaceInTexfile(solution, findString, additionalProjects);
99+
100100 std::ifstream file (solution);
101101 std::stringstream buffer;
102102 buffer << file.rdbuf ();
103103 string str = buffer.str ();
104104 file.close ();
105-
105+
106106 std::size_t pos = str.find (findString);
107107 if (pos != std::string::npos) {
108108 str.replace (pos, findString.length (), additionalProjects);
109109 }
110-
110+
111111 std::ofstream myfile (solution);
112112 myfile << str;
113113 myfile.close ();
114114
115115
116- // cout << fs::current_path() << endl;
117- // cout << fs::absolute(solution) << endl;
118- // cout << solution.lexically_normal() << endl;
116+ // cout << fs::current_path() << endl;
117+ // cout << fs::absolute(solution) << endl;
118+ // cout << solution.lexically_normal() << endl;
119119 }
120120
121-
122121
123- auto filters = projectDir / (projectName + " .vcxproj.filters" );
124- // alert ("saving filters file : " + filters.string(), 35);
122+
123+ auto filters { projectDir / (projectName + " .vcxproj.filters" ) };
124+ // alert ("saving filters file : " + filters.string(), 35);
125125 bool ok1 = filterXmlDoc.save_file (filters.c_str ());
126-
127- auto vcxFile = projectDir / (projectName + " .vcxproj" );
126+
127+ auto vcxFile { projectDir / (projectName + " .vcxproj" ) } ;
128128// alert ("saving vcxFile file : " + vcxFile.string(), 35);
129129 bool ok2 = doc.save_file (vcxFile.c_str ());
130130
@@ -134,8 +134,8 @@ bool visualStudioProject::saveProjectFile(){
134134
135135void visualStudioProject::appendFilter (string folderName){
136136 fixSlashOrder (folderName);
137- string uuid = generateUUID (folderName);
138- string tag = " //ItemGroup[Filter]/Filter[@Include=\" " + folderName + " \" ]" ;
137+ string uuid { generateUUID (folderName) } ;
138+ string tag { " //ItemGroup[Filter]/Filter[@Include=\" " + folderName + " \" ]" } ;
139139 pugi::xpath_node_set set = filterXmlDoc.select_nodes (tag.c_str ());
140140 if (set.size () > 0 ){
141141 // pugi::xml_node node = set[0].node();
0 commit comments