Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FormatUtils.cpp « FileManager « UI « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 553d8bcdf1476b4ac1d7ef37b4f1f7df70b4ba70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// FormatUtils.cpp

#include "StdAfx.h"

#include "FormatUtils.h"
#include "Common/IntToString.h"
#include "Windows/ResourceString.h"

#ifdef LANG
#include "LangUtils.h"
#endif

UString NumberToString(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(UINT resourceID, 
    #ifdef LANG
    UInt32 langID, 
    #endif
    const UString &argument)
{
  return MyFormatNew(
    #ifdef LANG
    LangString(resourceID, langID), 
    #else
    NWindows::MyLoadStringW(resourceID), 
    #endif
    argument);
}