ReactOS  0.4.15-dev-1207-g698a8e6
CAvailableApplicationInfo Class Reference

#include <available.h>

Collaboration diagram for CAvailableApplicationInfo:

Public Member Functions

 CAvailableApplicationInfo (const ATL::CStringW &sFileNameParam, AvailableStrings &m_Strings)
 
VOID RefreshAppInfo (AvailableStrings &m_Strings)
 
BOOL HasLanguageInfo () const
 
BOOL HasNativeLanguage () const
 
BOOL HasEnglishLanguage () const
 
BOOL IsInstalled () const
 
BOOL HasInstalledVersion () const
 
BOOL HasUpdate () const
 
BOOL RetrieveScrnshot (UINT Index, ATL::CStringW &ScrnshotLocation) const
 
BOOL RetrieveIcon (ATL::CStringW &IconLocation) const
 
VOID SetLastWriteTime (FILETIME *ftTime)
 

Public Attributes

INT m_Category
 
LicenseType m_LicenseType
 
ATL::CStringW m_szName
 
ATL::CStringW m_szRegName
 
ATL::CStringW m_szVersion
 
ATL::CStringW m_szLicense
 
ATL::CStringW m_szDesc
 
ATL::CStringW m_szSize
 
ATL::CStringW m_szUrlSite
 
ATL::CStringW m_szUrlDownload
 
ATL::CSimpleArray< LCIDm_LanguageLCIDs
 
ATL::CSimpleArray< ATL::CStringWm_szScrnshotLocation
 
ATL::CStringW m_szIconLocation
 
ATL::CStringW m_szPkgName
 
ULONG m_SizeBytes
 
ATL::CStringW m_sFileName
 
FILETIME m_ftCacheStamp
 
ATL::CStringW m_szSHA1
 
ATL::CStringW m_szInstalledVersion
 

Private Member Functions

BOOL GetString (LPCWSTR lpKeyName, ATL::CStringW &ReturnedString)
 
VOID RetrieveGeneralInfo (AvailableStrings &m_Strings)
 
VOID RetrieveInstalledStatus ()
 
VOID RetrieveInstalledVersion ()
 
VOID RetrieveLanguages ()
 
VOID RetrieveLicenseType ()
 
VOID RetrieveSize ()
 
BOOL FindInLanguages (LCID what) const
 

Private Attributes

BOOL m_IsInstalled
 
BOOL m_HasLanguageInfo
 
BOOL m_HasInstalledVersion
 
CConfigParserm_Parser
 

Detailed Description

Definition at line 40 of file available.h.

Constructor & Destructor Documentation

◆ CAvailableApplicationInfo()

CAvailableApplicationInfo::CAvailableApplicationInfo ( const ATL::CStringW sFileNameParam,
AvailableStrings m_Strings 
)

Definition at line 19 of file available.cpp.

20  : m_LicenseType(LICENSE_NONE), m_SizeBytes(0), m_sFileName(sFileNameParam),
22 {
23  RetrieveGeneralInfo(AvlbStrings);
24 }
VOID RetrieveGeneralInfo(AvailableStrings &m_Strings)
Definition: available.cpp:35
ATL::CStringW m_sFileName
Definition: available.h:62
#define FALSE
Definition: types.h:117
LicenseType m_LicenseType
Definition: available.h:45

Member Function Documentation

◆ FindInLanguages()

BOOL CAvailableApplicationInfo::FindInLanguages ( LCID  what) const
inlineprivate

Definition at line 229 of file available.cpp.

230 {
231  if (!m_HasLanguageInfo)
232  {
233  return FALSE;
234  }
235 
236  //Find locale code in the list
237  const INT nLanguagesSize = m_LanguageLCIDs.GetSize();
238  for (INT i = 0; i < nLanguagesSize; ++i)
239  {
240  if (m_LanguageLCIDs[i] == what)
241  {
242  return TRUE;
243  }
244  }
245 
246  return FALSE;
247 }
#define TRUE
Definition: types.h:120
int GetSize() const
Definition: atlsimpcoll.h:104
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
ATL::CSimpleArray< LCID > m_LanguageLCIDs
Definition: available.h:54

Referenced by HasEnglishLanguage(), and HasNativeLanguage().

◆ GetString()

BOOL CAvailableApplicationInfo::GetString ( LPCWSTR  lpKeyName,
ATL::CStringW ReturnedString 
)
inlineprivate

Definition at line 304 of file available.cpp.

305 {
306  if (!m_Parser->GetString(lpKeyName, ReturnedString))
307  {
308  ReturnedString.Empty();
309  return FALSE;
310  }
311  return TRUE;
312 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
CConfigParser * m_Parser
Definition: available.h:89
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:354

Referenced by RetrieveGeneralInfo(), and RetrieveSize().

◆ HasEnglishLanguage()

BOOL CAvailableApplicationInfo::HasEnglishLanguage ( ) const

Definition at line 259 of file available.cpp.

260 {
262 }
#define MAKELCID(lgid, srtid)
#define SUBLANG_DEFAULT
Definition: nls.h:168
BOOL FindInLanguages(LCID what) const
Definition: available.cpp:229
#define SORT_DEFAULT
#define LANG_ENGLISH
Definition: nls.h:52
#define MAKELANGID(p, s)
Definition: nls.h:15

◆ HasInstalledVersion()

BOOL CAvailableApplicationInfo::HasInstalledVersion ( ) const

Definition at line 269 of file available.cpp.

270 {
271  return m_HasInstalledVersion;
272 }

◆ HasLanguageInfo()

BOOL CAvailableApplicationInfo::HasLanguageInfo ( ) const

Definition at line 249 of file available.cpp.

250 {
251  return m_HasLanguageInfo;
252 }

◆ HasNativeLanguage()

BOOL CAvailableApplicationInfo::HasNativeLanguage ( ) const

Definition at line 254 of file available.cpp.

255 {
257 }
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:768
BOOL FindInLanguages(LCID what) const
Definition: available.cpp:229

◆ HasUpdate()

BOOL CAvailableApplicationInfo::HasUpdate ( ) const

Definition at line 274 of file available.cpp.

275 {
277 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
ATL::CStringW m_szVersion
Definition: available.h:48
ATL::CStringW m_szInstalledVersion
Definition: available.h:67
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:653

◆ IsInstalled()

BOOL CAvailableApplicationInfo::IsInstalled ( ) const

Definition at line 264 of file available.cpp.

265 {
266  return m_IsInstalled;
267 }

◆ RefreshAppInfo()

VOID CAvailableApplicationInfo::RefreshAppInfo ( AvailableStrings m_Strings)

Definition at line 26 of file available.cpp.

27 {
29  {
30  RetrieveGeneralInfo(AvlbStrings);
31  }
32 }
VOID RetrieveGeneralInfo(AvailableStrings &m_Strings)
Definition: available.cpp:35
ATL::CStringW m_szUrlDownload
Definition: available.h:53
bool IsEmpty() const
Definition: atlsimpstr.h:379

◆ RetrieveGeneralInfo()

VOID CAvailableApplicationInfo::RetrieveGeneralInfo ( AvailableStrings m_Strings)
private

Definition at line 35 of file available.cpp.

36 {
38 
39  // TODO: I temporarily use the file name (without suffix) as package name.
40  // It should be better to put this in a field of ini file.
41  // consider write a converter to do this and write a github action for rapps-db to ensure package_name is unique.
45 
46  m_Parser->GetInt(L"Category", m_Category);
47 
48  if (!GetString(L"Name", m_szName)
49  || !GetString(L"URLDownload", m_szUrlDownload))
50  {
51  delete m_Parser;
52  return;
53  }
54 
55  GetString(L"RegName", m_szRegName);
56  GetString(L"Version", m_szVersion);
57  GetString(L"License", m_szLicense);
58  GetString(L"Description", m_szDesc);
59  GetString(L"URLSite", m_szUrlSite);
60  GetString(L"SHA1", m_szSHA1);
61 
62  static_assert(MAX_SCRNSHOT_NUM < 10000, "MAX_SCRNSHOT_NUM is too big");
63  for (int i = 0; i < MAX_SCRNSHOT_NUM; i++)
64  {
65  CStringW ScrnshotField;
66  ScrnshotField.Format(L"Screenshot%d", i + 1);
67  CStringW ScrnshotLocation;
68  if (!GetString(ScrnshotField, ScrnshotLocation))
69  {
70  // We stop at the first screenshot not found,
71  // so screenshots _have_ to be consecutive
72  break;
73  }
74 
75 
76  if (PathIsURLW(ScrnshotLocation.GetString()))
77  {
78  m_szScrnshotLocation.Add(ScrnshotLocation);
79  }
80  else
81  {
82  // TODO: Does the filename contain anything stuff like ":" "<" ">" ?
83  // these stuff may lead to security issues
84  ATL::CStringW ScrnshotName = AvlbStrings.szAppsPath;
85  PathAppendW(ScrnshotName.GetBuffer(MAX_PATH), L"screenshots");
86  BOOL bSuccess = PathAppendNoDirEscapeW(ScrnshotName.GetBuffer(), ScrnshotLocation.GetString());
87  ScrnshotName.ReleaseBuffer();
88  if (bSuccess)
89  {
90  m_szScrnshotLocation.Add(ScrnshotName);
91  }
92  }
93  }
94 
95  ATL::CStringW IconPath = AvlbStrings.szAppsPath;
96  PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
97 
98  // TODO: are we going to support specify an URL for an icon ?
100  if (GetString(L"Icon", IconLocation))
101  {
102  BOOL bSuccess = PathAppendNoDirEscapeW(IconPath.GetBuffer(), IconLocation.GetString());
103  IconPath.ReleaseBuffer();
104 
105  if (!bSuccess)
106  {
107  IconPath.Empty();
108  }
109  }
110  else
111  {
112  // inifile.ico
113  PathAppendW(IconPath.GetBuffer(), m_szPkgName);
114  IconPath.ReleaseBuffer();
115  IconPath += L".ico";
116  }
117 
118  if (!IconPath.IsEmpty())
119  {
121  {
123  }
124  }
125 
126  RetrieveSize();
130 
131  if (m_IsInstalled)
132  {
134  }
135 
136  delete m_Parser;
137 }
ATL::CStringW m_sFileName
Definition: available.h:62
ATL::CStringW m_szPkgName
Definition: available.h:57
ATL::CStringW m_szLicense
Definition: available.h:49
ATL::CSimpleArray< ATL::CStringW > m_szScrnshotLocation
Definition: available.h:55
ATL::CStringW m_szUrlSite
Definition: available.h:52
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:716
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:392
static BOOLEAN bSuccess
Definition: drive.cpp:419
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
Definition: url.c:2432
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW &ReturnedString)
Definition: available.cpp:304
ATL::CStringW m_szDesc
Definition: available.h:50
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:818
ATL::CStringW m_szUrlDownload
Definition: available.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
ATL::CStringW m_szVersion
Definition: available.h:48
#define MAX_PATH
Definition: compat.h:34
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define MAX_SCRNSHOT_NUM
Definition: available.h:11
ATL::CStringW m_szRegName
Definition: available.h:47
static const WCHAR L[]
Definition: oid.c:1250
ATL::CStringW m_szName
Definition: available.h:46
CConfigParser * m_Parser
Definition: available.h:89
ATL::CStringW m_szIconLocation
Definition: available.h:56
static const WCHAR IconPath[]
Definition: install.c:51
BOOL PathAppendNoDirEscapeW(LPWSTR pszPath, LPCWSTR pszMore)
Definition: misc.cpp:414
ATL::CStringW m_szSHA1
Definition: available.h:66

Referenced by CAvailableApplicationInfo(), and RefreshAppInfo().

◆ RetrieveIcon()

BOOL CAvailableApplicationInfo::RetrieveIcon ( ATL::CStringW IconLocation) const

Definition at line 289 of file available.cpp.

290 {
292  {
293  return FALSE;
294  }
296  return TRUE;
297 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
bool IsEmpty() const
Definition: atlsimpstr.h:379
ATL::CStringW m_szIconLocation
Definition: available.h:56

Referenced by CAppsListView::AddAvailableApplication().

◆ RetrieveInstalledStatus()

VOID CAvailableApplicationInfo::RetrieveInstalledStatus ( )
private

Definition at line 139 of file available.cpp.

140 {
143 }
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:310
smooth NULL
Definition: ftsmooth.c:416
ATL::CStringW m_szRegName
Definition: available.h:47
ATL::CStringW m_szName
Definition: available.h:46

Referenced by RetrieveGeneralInfo().

◆ RetrieveInstalledVersion()

VOID CAvailableApplicationInfo::RetrieveInstalledVersion ( )
private

Definition at line 145 of file available.cpp.

146 {
147  ATL::CStringW szNameVersion;
148  szNameVersion = m_szName + L" " + m_szVersion;
151  || ::GetInstalledVersion(&m_szInstalledVersion, szNameVersion);
152 }
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:310
ATL::CStringW m_szVersion
Definition: available.h:48
ATL::CStringW m_szInstalledVersion
Definition: available.h:67
ATL::CStringW m_szRegName
Definition: available.h:47
static const WCHAR L[]
Definition: oid.c:1250
ATL::CStringW m_szName
Definition: available.h:46

Referenced by RetrieveGeneralInfo().

◆ RetrieveLanguages()

VOID CAvailableApplicationInfo::RetrieveLanguages ( )
private

Definition at line 154 of file available.cpp.

155 {
156  const WCHAR cDelimiter = L'|';
157  ATL::CStringW szBuffer;
158 
159  // TODO: Get multiline parameter
160  if (!m_Parser->GetString(L"Languages", szBuffer))
161  {
163  return;
164  }
165 
166  // Parse parameter string
167  ATL::CStringW m_szLocale;
168  INT iLCID;
169  for (INT i = 0; szBuffer[i] != UNICODE_NULL; ++i)
170  {
171  if (szBuffer[i] != cDelimiter && szBuffer[i] != L'\n')
172  {
173  m_szLocale += szBuffer[i];
174  }
175  else
176  {
177  if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
178  {
179  m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
180  m_szLocale.Empty();
181  }
182  }
183  }
184 
185  // For the text after delimiter
186  if (!m_szLocale.IsEmpty())
187  {
188  if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
189  {
190  m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
191  }
192  }
193 
195 }
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define STIF_DEFAULT
Definition: shlwapi.h:1451
#define TRUE
Definition: types.h:120
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
ATL::CSimpleArray< LCID > m_LanguageLCIDs
Definition: available.h:54
__wchar_t WCHAR
Definition: xmlstorage.h:180
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet)
Definition: string.c:970
static const WCHAR L[]
Definition: oid.c:1250
bool IsEmpty() const
Definition: atlsimpstr.h:379
CConfigParser * m_Parser
Definition: available.h:89
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:354

Referenced by RetrieveGeneralInfo().

◆ RetrieveLicenseType()

VOID CAvailableApplicationInfo::RetrieveLicenseType ( )
private

Definition at line 197 of file available.cpp.

198 {
199  INT IntBuffer;
200 
201  m_Parser->GetInt(L"LicenseType", IntBuffer);
202 
203  if (IsLicenseType(IntBuffer))
204  {
205  m_LicenseType = static_cast<LicenseType>(IntBuffer);
206  }
207  else
208  {
210  }
211 }
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:392
BOOL IsLicenseType(INT x)
Definition: available.h:23
int32_t INT
Definition: typedefs.h:58
static const WCHAR L[]
Definition: oid.c:1250
CConfigParser * m_Parser
Definition: available.h:89
LicenseType m_LicenseType
Definition: available.h:45

Referenced by RetrieveGeneralInfo().

◆ RetrieveScrnshot()

BOOL CAvailableApplicationInfo::RetrieveScrnshot ( UINT  Index,
ATL::CStringW ScrnshotLocation 
) const

Definition at line 279 of file available.cpp.

280 {
281  if (Index >= (UINT)m_szScrnshotLocation.GetSize())
282  {
283  return FALSE;
284  }
285  ScrnshotLocation = m_szScrnshotLocation[Index];
286  return TRUE;
287 }
#define TRUE
Definition: types.h:120
ATL::CSimpleArray< ATL::CStringW > m_szScrnshotLocation
Definition: available.h:55
#define FALSE
Definition: types.h:117
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned int UINT
Definition: ndis.h:50

◆ RetrieveSize()

VOID CAvailableApplicationInfo::RetrieveSize ( )
private

Definition at line 213 of file available.cpp.

214 {
215  INT iSizeBytes;
216 
217  if (!m_Parser->GetInt(L"SizeBytes", iSizeBytes))
218  {
219  // fall back to "Size" string
220  GetString(L"Size", m_szSize);
221  return;
222  }
223 
224  m_SizeBytes = iSizeBytes;
227 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:392
int32_t INT
Definition: typedefs.h:58
BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW &ReturnedString)
Definition: available.cpp:304
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
ATL::CStringW m_szSize
Definition: available.h:51
#define MAX_PATH
Definition: compat.h:34
static const WCHAR L[]
Definition: oid.c:1250
CConfigParser * m_Parser
Definition: available.h:89

Referenced by RetrieveGeneralInfo().

◆ SetLastWriteTime()

VOID CAvailableApplicationInfo::SetLastWriteTime ( FILETIME ftTime)

Definition at line 299 of file available.cpp.

300 {
301  RtlCopyMemory(&m_ftCacheStamp, ftTime, sizeof(FILETIME));
302 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)

Member Data Documentation

◆ m_Category

INT CAvailableApplicationInfo::m_Category

Definition at line 43 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_ftCacheStamp

FILETIME CAvailableApplicationInfo::m_ftCacheStamp

Definition at line 63 of file available.h.

Referenced by SetLastWriteTime().

◆ m_HasInstalledVersion

BOOL CAvailableApplicationInfo::m_HasInstalledVersion
private

Definition at line 88 of file available.h.

Referenced by HasInstalledVersion(), and RetrieveInstalledVersion().

◆ m_HasLanguageInfo

BOOL CAvailableApplicationInfo::m_HasLanguageInfo
private

Definition at line 87 of file available.h.

Referenced by FindInLanguages(), HasLanguageInfo(), and RetrieveLanguages().

◆ m_IsInstalled

BOOL CAvailableApplicationInfo::m_IsInstalled
private

Definition at line 86 of file available.h.

Referenced by IsInstalled(), RetrieveGeneralInfo(), and RetrieveInstalledStatus().

◆ m_LanguageLCIDs

ATL::CSimpleArray<LCID> CAvailableApplicationInfo::m_LanguageLCIDs

Definition at line 54 of file available.h.

Referenced by FindInLanguages(), and RetrieveLanguages().

◆ m_LicenseType

LicenseType CAvailableApplicationInfo::m_LicenseType

Definition at line 45 of file available.h.

Referenced by RetrieveLicenseType().

◆ m_Parser

CConfigParser* CAvailableApplicationInfo::m_Parser
private

◆ m_sFileName

ATL::CStringW CAvailableApplicationInfo::m_sFileName

Definition at line 62 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_SizeBytes

ULONG CAvailableApplicationInfo::m_SizeBytes

Definition at line 59 of file available.h.

Referenced by RetrieveSize().

◆ m_szDesc

ATL::CStringW CAvailableApplicationInfo::m_szDesc

◆ m_szIconLocation

ATL::CStringW CAvailableApplicationInfo::m_szIconLocation

Definition at line 56 of file available.h.

Referenced by RetrieveGeneralInfo(), and RetrieveIcon().

◆ m_szInstalledVersion

ATL::CStringW CAvailableApplicationInfo::m_szInstalledVersion

Definition at line 67 of file available.h.

Referenced by HasUpdate(), and RetrieveInstalledVersion().

◆ m_szLicense

ATL::CStringW CAvailableApplicationInfo::m_szLicense

Definition at line 49 of file available.h.

Referenced by HandleInfoCommand(), and RetrieveGeneralInfo().

◆ m_szName

◆ m_szPkgName

ATL::CStringW CAvailableApplicationInfo::m_szPkgName

Definition at line 57 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szRegName

ATL::CStringW CAvailableApplicationInfo::m_szRegName

◆ m_szScrnshotLocation

ATL::CSimpleArray<ATL::CStringW> CAvailableApplicationInfo::m_szScrnshotLocation

Definition at line 55 of file available.h.

Referenced by RetrieveGeneralInfo(), and RetrieveScrnshot().

◆ m_szSHA1

ATL::CStringW CAvailableApplicationInfo::m_szSHA1

Definition at line 66 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szSize

ATL::CStringW CAvailableApplicationInfo::m_szSize

Definition at line 51 of file available.h.

Referenced by HandleInfoCommand(), and RetrieveSize().

◆ m_szUrlDownload

ATL::CStringW CAvailableApplicationInfo::m_szUrlDownload

Definition at line 53 of file available.h.

Referenced by HandleInfoCommand(), RefreshAppInfo(), and RetrieveGeneralInfo().

◆ m_szUrlSite

ATL::CStringW CAvailableApplicationInfo::m_szUrlSite

Definition at line 52 of file available.h.

Referenced by HandleInfoCommand(), and RetrieveGeneralInfo().

◆ m_szVersion

ATL::CStringW CAvailableApplicationInfo::m_szVersion

The documentation for this class was generated from the following files: