ReactOS 0.4.16-dev-751-g45ed1a9
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

static AppsCategories ClampAvailableCategory (AppsCategories Category)
 
int CompareVersion (const CStringW &left, const CStringW &right)
 

Macro Definition Documentation

◆ MAX_SCRNSHOT_NUM

#define MAX_SCRNSHOT_NUM   16

Definition at line 317 of file appinfo.cpp.

Function Documentation

◆ ClampAvailableCategory()

static AppsCategories ClampAvailableCategory ( AppsCategories  Category)
inlinestatic

Definition at line 14 of file appinfo.cpp.

15{
16 if (Category <= ENUM_LASTCATEGORY)
17 return Category;
18 return ENUM_CAT_OTHER; // Treat future categories we don't know as Other
19}
@ ENUM_LASTCATEGORY
Definition: appinfo.h:44
@ ENUM_CAT_OTHER
Definition: appinfo.h:42

◆ CompareVersion()

int CompareVersion ( const CStringW left,
const CStringW right 
)

Definition at line 93 of file appinfo.cpp.

94{
95 int nLeft = 0, nRight = 0;
96
97 while (true)
98 {
99 CStringW leftPart = left.Tokenize(L".", nLeft);
100 CStringW rightPart = right.Tokenize(L".", nRight);
101
102 if (leftPart.IsEmpty() && rightPart.IsEmpty())
103 return 0;
104 if (leftPart.IsEmpty())
105 return -1;
106 if (rightPart.IsEmpty())
107 return 1;
108
109 int leftVal, rightVal;
110
111 if (!StrToIntExW(leftPart, STIF_DEFAULT, &leftVal))
112 leftVal = 0;
113 if (!StrToIntExW(rightPart, STIF_DEFAULT, &rightVal))
114 rightVal = 0;
115
116 if (leftVal > rightVal)
117 return 1;
118 if (rightVal < leftVal)
119 return -1;
120 }
121}
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, int *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().