mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-19 01:04:20 +00:00
Added Value support to the Button's toggle state and TextEditor content. Refactored the atomic operation functions to live inside a class called Atomic, and the byte order functions into a class called ByteOrder.
This commit is contained in:
parent
3ddbc82f9f
commit
18ffeba9da
64 changed files with 3721 additions and 3609 deletions
|
|
@ -335,28 +335,20 @@ const String Time::toString (const bool includeDate,
|
|||
|
||||
const String Time::formatted (const tchar* const format) const throw()
|
||||
{
|
||||
tchar buffer[80];
|
||||
String buffer;
|
||||
int bufferSize = 128;
|
||||
buffer.preallocateStorage (bufferSize);
|
||||
|
||||
struct tm t;
|
||||
millisToLocal (millisSinceEpoch, t);
|
||||
|
||||
if (CharacterFunctions::ftime (buffer, 79, format, &t) <= 0)
|
||||
while (CharacterFunctions::ftime ((tchar*) (const tchar*) buffer, bufferSize, format, &t) <= 0)
|
||||
{
|
||||
int bufferSize = 128;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
MemoryBlock mb (bufferSize * sizeof (tchar));
|
||||
tchar* const b = (tchar*) mb.getData();
|
||||
|
||||
if (CharacterFunctions::ftime (b, bufferSize, format, &t) > 0)
|
||||
return String (b);
|
||||
|
||||
bufferSize += 128;
|
||||
}
|
||||
bufferSize += 128;
|
||||
buffer.preallocateStorage (bufferSize);
|
||||
}
|
||||
|
||||
return String (buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue