other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // FormatUtils.cpp
michael@0 2
michael@0 3 #include "StdAfx.h"
michael@0 4
michael@0 5 #include "FormatUtils.h"
michael@0 6 #include "Common/IntToString.h"
michael@0 7 #include "Windows/ResourceString.h"
michael@0 8
michael@0 9 #ifdef LANG
michael@0 10 #include "LangUtils.h"
michael@0 11 #endif
michael@0 12
michael@0 13 UString NumberToString(UInt64 number)
michael@0 14 {
michael@0 15 wchar_t numberString[32];
michael@0 16 ConvertUInt64ToString(number, numberString);
michael@0 17 return numberString;
michael@0 18 }
michael@0 19
michael@0 20 UString MyFormatNew(const UString &format, const UString &argument)
michael@0 21 {
michael@0 22 UString result = format;
michael@0 23 result.Replace(L"{0}", argument);
michael@0 24 return result;
michael@0 25 }
michael@0 26
michael@0 27 UString MyFormatNew(UINT resourceID,
michael@0 28 #ifdef LANG
michael@0 29 UInt32 langID,
michael@0 30 #endif
michael@0 31 const UString &argument)
michael@0 32 {
michael@0 33 return MyFormatNew(
michael@0 34 #ifdef LANG
michael@0 35 LangString(resourceID, langID),
michael@0 36 #else
michael@0 37 NWindows::MyLoadStringW(resourceID),
michael@0 38 #endif
michael@0 39 argument);
michael@0 40 }

mercurial