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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +// FormatUtils.cpp
     1.5 +
     1.6 +#include "StdAfx.h"
     1.7 +
     1.8 +#include "FormatUtils.h"
     1.9 +#include "Common/IntToString.h"
    1.10 +#include "Windows/ResourceString.h"
    1.11 +
    1.12 +#ifdef LANG
    1.13 +#include "LangUtils.h"
    1.14 +#endif
    1.15 +
    1.16 +UString NumberToString(UInt64 number)
    1.17 +{
    1.18 +  wchar_t numberString[32];
    1.19 +  ConvertUInt64ToString(number, numberString);
    1.20 +  return numberString;
    1.21 +}
    1.22 +
    1.23 +UString MyFormatNew(const UString &format, const UString &argument)
    1.24 +{
    1.25 +  UString result = format;
    1.26 +  result.Replace(L"{0}", argument);
    1.27 +  return result;
    1.28 +}
    1.29 +
    1.30 +UString MyFormatNew(UINT resourceID, 
    1.31 +    #ifdef LANG
    1.32 +    UInt32 langID, 
    1.33 +    #endif
    1.34 +    const UString &argument)
    1.35 +{
    1.36 +  return MyFormatNew(
    1.37 +    #ifdef LANG
    1.38 +    LangString(resourceID, langID), 
    1.39 +    #else
    1.40 +    NWindows::MyLoadStringW(resourceID), 
    1.41 +    #endif
    1.42 +    argument);
    1.43 +}

mercurial