|
|
@ -83,11 +83,30 @@ void printDownload(const std::string &str)
|
|
|
|
static const uint maxLength = 160;
|
|
|
|
static const uint maxLength = 160;
|
|
|
|
static char spaces[maxLength];
|
|
|
|
static char spaces[maxLength];
|
|
|
|
|
|
|
|
|
|
|
|
memset(spaces, ' ', previousLength);
|
|
|
|
uint length = 0;
|
|
|
|
spaces[previousLength] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "erase" previous line
|
|
|
|
if (useUtf8)
|
|
|
|
printf("%s\r", spaces);
|
|
|
|
{
|
|
|
|
|
|
|
|
ucstring utf8Str;
|
|
|
|
|
|
|
|
utf8Str.fromUtf8(str);
|
|
|
|
|
|
|
|
length = (uint)utf8Str.length();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
length = (uint)str.length();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sint diff = length - previousLength;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (diff > 0 && length < maxLength)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
memset(spaces, ' ', length);
|
|
|
|
|
|
|
|
spaces[length] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "erase" previous line
|
|
|
|
|
|
|
|
printf("%s\r", spaces);
|
|
|
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// display download in purple
|
|
|
|
// display download in purple
|
|
|
|
if (useEsc)
|
|
|
|
if (useEsc)
|
|
|
@ -109,7 +128,9 @@ void printDownload(const std::string &str)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
previousLength = (uint)str.length();
|
|
|
|
fflush(stdout);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
previousLength = length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|