mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-11 00:07:09 -06:00
3.13
This commit is contained in:
76
7zip/FileManager/FormatUtils.cpp
Executable file
76
7zip/FileManager/FormatUtils.cpp
Executable file
@@ -0,0 +1,76 @@
|
||||
// FormatUtils.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "FormatUtils.h"
|
||||
#include "Windows/ResourceString.h"
|
||||
#include "Common/IntToString.h"
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#ifdef LANG
|
||||
#include "LangUtils.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
CSysString MyFormat(const CSysString &format, const CSysString &argument)
|
||||
{
|
||||
CSysString result;
|
||||
_stprintf(result.GetBuffer(format.Length() + argument.Length() + 2),
|
||||
format, argument);
|
||||
result.ReleaseBuffer();
|
||||
return result;
|
||||
}
|
||||
|
||||
CSysString MyFormat(UINT32 resourceID,
|
||||
#ifdef LANG
|
||||
UINT32 aLangID,
|
||||
#endif
|
||||
const CSysString &argument)
|
||||
{
|
||||
return MyFormat(
|
||||
#ifdef LANG
|
||||
LangLoadString(resourceID, aLangID),
|
||||
#else
|
||||
NWindows::MyLoadString(resourceID),
|
||||
#endif
|
||||
|
||||
argument);
|
||||
}
|
||||
*/
|
||||
|
||||
CSysString NumberToString(UINT64 number)
|
||||
{
|
||||
TCHAR temp[32];
|
||||
ConvertUINT64ToString(number, temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
UString NumberToStringW(UINT64 number)
|
||||
{
|
||||
wchar_t numberString[32];
|
||||
ConvertUINT64ToString(number, numberString);
|
||||
return numberString;
|
||||
}
|
||||
|
||||
UString MyFormatNew(const UString &format, const UString &argument)
|
||||
{
|
||||
UString result = format;
|
||||
result.Replace(L"{0}", argument);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
UString MyFormatNew(UINT32 resourceID,
|
||||
#ifdef LANG
|
||||
UINT32 aLangID,
|
||||
#endif
|
||||
const UString &argument)
|
||||
{
|
||||
return MyFormatNew(
|
||||
#ifdef LANG
|
||||
LangLoadStringW(resourceID, aLangID),
|
||||
#else
|
||||
NWindows::MyLoadStringW(resourceID),
|
||||
#endif
|
||||
argument);
|
||||
}
|
||||
Reference in New Issue
Block a user