MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ConvertLoopMode

Method ConvertLoopMode

source/script.h:1220–1250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1218 }
1219
1220 static FileLoopModeType ConvertLoopMode(LPTSTR aBuf)
1221 // Returns the file loop mode, or FILE_LOOP_INVALID if aBuf contains an invalid mode.
1222 {
1223 for (FileLoopModeType mode = FILE_LOOP_INVALID;;)
1224 {
1225 switch (ctoupper(*aBuf++))
1226 {
1227 // For simplicity, both are allowed with either kind of loop:
1228 case 'F': // Files
1229 case 'V': // Values
1230 mode |= FILE_LOOP_FILES_ONLY;
1231 break;
1232 case 'D': // Directories
1233 case 'K': // Keys
1234 mode |= FILE_LOOP_FOLDERS_ONLY;
1235 break;
1236 case 'R':
1237 mode |= FILE_LOOP_RECURSE;
1238 break;
1239 case ' ': // Allow whitespace.
1240 case '\t': //
1241 break;
1242 case '\0':
1243 if ((mode & FILE_LOOP_FILES_AND_FOLDERS) == 0)
1244 mode |= FILE_LOOP_FILES_ONLY; // Set default.
1245 return mode;
1246 default: // Invalid character.
1247 return FILE_LOOP_INVALID;
1248 }
1249 }
1250 }
1251
1252 static int ConvertRunMode(LPTSTR aBuf)
1253 // Returns the matching WinShow mode, or SW_SHOWNORMAL if none.

Callers

nothing calls this directly

Calls 1

ctoupperFunction · 0.85

Tested by

no test coverage detected