OutpostUniverse / OP2Archive

Console Application for examining, creating, and extracting files from Outpost 2 .vol and .clm archives.
https://wiki.outpost2.net/doku.php?id=outpost_2:helper_programs:op2archive
MIT License
1 stars 0 forks source link

Update range based loops to use auto where appropriate #2

Closed Brett208 closed 6 years ago

DanRStevens commented 6 years ago

In case this is helpful:

grep -rn 'for\s*[(].*[^:]:[^:].*[)]' *

ConsoleAdd.cpp:39:  for (string fileToAdd : filesToAdd)
ConsoleAdd.cpp:79:  for (string filename : filenames)
ConsoleArgumentParser.cpp:26:   for (ConsoleSwitch consoleSwitch : consoleSwitches)
ConsoleCreate.cpp:161:  for (string filename : paths) {
ConsoleCreate.cpp:174:  for (std::string internalName : internalNames)
ConsoleExtract.cpp:33:  for (string archiveFilename : archiveFilenames)
ConsoleFind.cpp:11: for (string path : consoleArgs.paths) {
ConsoleList.cpp:15: for (string path : consoleArgs.paths)
ConsoleList.cpp:42: for (const string& filename : archiveFilenames) {
OP2Utility/Maps/MapWriter.cpp:62:           for (const auto& tilesetSource : tileSetSources)
OP2Utility/Maps/MapWriter.cpp:94:           for (const auto& tileGroup : tileGroups)
OP2Utility/Archives/ArchivePacker.cpp:19:       for (const std::string& fileName : paths) {
OP2Utility/Archives/ClmFile.cpp:160:        for (const auto& fileName : filesToPack) {
OP2Utility/Archives/ClmFile.cpp:306:        for (const auto& path : paths) {
OP2Utility/Archives/VolFile.cpp:274:        for (const auto& filename : volInfo.filesToPack) {
OP2Utility/XFile.cpp:75:    for (const auto& entry : fs::directory_iterator(pathStr)) {
OP2Utility/StringHelper.cpp:7:  for (auto & c : str) {
OP2Utility/StringHelper.cpp:27:     for (const auto& stringToRemove : stringsToRemove) {
OP2Utility/ResourceManager.cpp:13:  for (const auto& volFilename : volFilenames) {
OP2Utility/ResourceManager.cpp:19:  for (const auto& clmFilename : clmFilenames) {
OP2Utility/ResourceManager.cpp:36:  for (const auto& archiveFile : ArchiveFiles)
OP2Utility/ResourceManager.cpp:55:  for (const auto& archiveFile : ArchiveFiles)
OP2Utility/ResourceManager.cpp:76:  for (const auto& archiveFile : ArchiveFiles)
OP2Utility/ResourceManager.cpp:128: for (const auto& archiveFile : ArchiveFiles)
OP2Utility/ResourceManager.cpp:156: for (const auto& archiveFile : ArchiveFiles)
Brett208 commented 6 years ago

Thanks for providing. I'm becoming a big fan of Grep. While Visual Studio has a decent in place find and replace system, when the assignment gets more complex, I find Grep easier to use.

I'm about halfway through reviewing the for loops in both OP2Archive and OP2Utility.

-Brett