MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / GetLoopFileSize

Method GetLoopFileSize

Source/script.cpp:11001–11023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10999}
11000
11001VarSizeType Script::GetLoopFileSize(char *aBuf, int aDivider)
11002{
11003 // Don't use MAX_NUMBER_LENGTH in case user has selected a very long float format via SetFormat.
11004 char str[128];
11005 char *target_buf = aBuf ? aBuf : str;
11006 *target_buf = '\0'; // Set default.
11007 if (mLoopFile)
11008 {
11009 // It's a documented limitation that the size will show as negative if
11010 // greater than 2 gig, and will be wrong if greater than 4 gig. For files
11011 // that large, scripts should use the KB version of this function instead.
11012 // If a file is over 4gig, set the value to be the maximum size (-1 when
11013 // expressed as a signed integer, since script variables are based entirely
11014 // on 32-bit signed integers due to the use of ATOI(), etc.). UPDATE: 64-bit
11015 // ints are now standard, so the above is unnecessary:
11016 //sprintf(str, "%d%", mLoopFile->nFileSizeHigh ? -1 : (int)mLoopFile->nFileSizeLow);
11017 ULARGE_INTEGER ul;
11018 ul.HighPart = mLoopFile->nFileSizeHigh;
11019 ul.LowPart = mLoopFile->nFileSizeLow;
11020 ITOA64((__int64)(aDivider ? ((unsigned __int64)ul.QuadPart / aDivider) : ul.QuadPart), target_buf);
11021 }
11022 return (VarSizeType)strlen(target_buf);
11023}
11024
11025VarSizeType Script::GetLoopRegType(char *aBuf)
11026{

Callers 1

GetMethod · 0.80

Calls 1

ITOA64Function · 0.85

Tested by

no test coverage detected