ReactOS 0.4.16-dev-297-gc569aee
appinfo.cpp File Reference
#include "rapps.h"
#include "appview.h"
Include dependency graph for appinfo.cpp:

Go to the source code of this file.

Macros

#define MAX_SCRNSHOT_NUM   16
 

Functions

int CompareVersion (const CStringW &left, const CStringW &right)
 

Macro Definition Documentation

◆ MAX_SCRNSHOT_NUM

#define MAX_SCRNSHOT_NUM   16

Definition at line 309 of file appinfo.cpp.

Function Documentation

◆ CompareVersion()

int CompareVersion ( const CStringW left,
const CStringW right 
)

Definition at line 85 of file appinfo.cpp.

86{
87 int nLeft = 0, nRight = 0;
88
89 while (true)
90 {
91 CStringW leftPart = left.Tokenize(L".", nLeft);
92 CStringW rightPart = right.Tokenize(L".", nRight);
93
94 if (leftPart.IsEmpty() && rightPart.IsEmpty())
95 return 0;
96 if (leftPart.IsEmpty())
97 return -1;
98 if (rightPart.IsEmpty())
99 return 1;
100
101 int leftVal, rightVal;
102
103 if (!StrToIntExW(leftPart, STIF_DEFAULT, &leftVal))
104 leftVal = 0;
105 if (!StrToIntExW(rightPart, STIF_DEFAULT, &rightVal))
106 rightVal = 0;
107
108 if (leftVal > rightVal)
109 return 1;
110 if (rightVal < leftVal)
111 return -1;
112 }
113}
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
CStringT Tokenize(_In_z_ PCXSTR pszTokens, _Inout_ int &iStart) const
Definition: cstringt.h:947
BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet)
Definition: string.c:970
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
#define L(x)
Definition: ntvdm.h:50
#define STIF_DEFAULT
Definition: shlwapi.h:1477

Referenced by CAvailableApplicationInfo::InsertVersionInfo().