ReactOS  0.4.13-dev-563-g0561610
CAvailableApplicationInfo Struct Reference

#include <available.h>

Collaboration diagram for CAvailableApplicationInfo:

Public Member Functions

 CAvailableApplicationInfo (const ATL::CStringW &sFileNameParam)
 
VOID RefreshAppInfo ()
 
BOOL HasLanguageInfo () const
 
BOOL HasNativeLanguage () const
 
BOOL HasEnglishLanguage () const
 
BOOL IsInstalled () const
 
BOOL HasInstalledVersion () const
 
BOOL HasUpdate () const
 
VOID SetLastWriteTime (FILETIME *ftTime)
 

Public Attributes

INT m_Category
 
BOOL m_IsSelected
 
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::CStringW m_szCDPath
 
ATL::CSimpleArray< LCIDm_LanguageLCIDs
 
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 ()
 
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 25 of file available.h.

Constructor & Destructor Documentation

◆ CAvailableApplicationInfo()

CAvailableApplicationInfo::CAvailableApplicationInfo ( const ATL::CStringW sFileNameParam)

Member Function Documentation

◆ FindInLanguages()

BOOL CAvailableApplicationInfo::FindInLanguages ( LCID  what) const
inlineprivate

Definition at line 161 of file available.cpp.

162 {
163  if (!m_HasLanguageInfo)
164  {
165  return FALSE;
166  }
167 
168  //Find locale code in the list
169  const INT nLanguagesSize = m_LanguageLCIDs.GetSize();
170  for (INT i = 0; i < nLanguagesSize; ++i)
171  {
172  if (m_LanguageLCIDs[i] == what)
173  {
174  return TRUE;
175  }
176  }
177 
178  return FALSE;
179 }
#define TRUE
Definition: types.h:120
int GetSize() const
Definition: atlsimpcoll.h:104
int32_t INT
Definition: typedefs.h:56
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
ATL::CSimpleArray< LCID > m_LanguageLCIDs
Definition: available.h:39

Referenced by HasEnglishLanguage(), and HasNativeLanguage().

◆ GetString()

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

Definition at line 216 of file available.cpp.

217 {
218  if (!m_Parser->GetString(lpKeyName, ReturnedString))
219  {
220  ReturnedString.Empty();
221  return FALSE;
222  }
223  return TRUE;
224 }
#define TRUE
Definition: types.h:120
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:357
CConfigParser * m_Parser
Definition: available.h:68

Referenced by RetrieveGeneralInfo(), and RetrieveSize().

◆ HasEnglishLanguage()

BOOL CAvailableApplicationInfo::HasEnglishLanguage ( ) const

Definition at line 191 of file available.cpp.

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

◆ HasInstalledVersion()

BOOL CAvailableApplicationInfo::HasInstalledVersion ( ) const

Definition at line 201 of file available.cpp.

202 {
203  return m_HasInstalledVersion;
204 }

◆ HasLanguageInfo()

BOOL CAvailableApplicationInfo::HasLanguageInfo ( ) const

Definition at line 181 of file available.cpp.

182 {
183  return m_HasLanguageInfo;
184 }

◆ HasNativeLanguage()

BOOL CAvailableApplicationInfo::HasNativeLanguage ( ) const

Definition at line 186 of file available.cpp.

187 {
189 }
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:768
BOOL FindInLanguages(LCID what) const
Definition: available.cpp:161

◆ HasUpdate()

BOOL CAvailableApplicationInfo::HasUpdate ( ) const

Definition at line 206 of file available.cpp.

207 {
209 }
#define TRUE
Definition: types.h:120
ATL::CStringW m_szVersion
Definition: available.h:32
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:605
ATL::CStringW m_szInstalledVersion
Definition: available.h:47

◆ IsInstalled()

BOOL CAvailableApplicationInfo::IsInstalled ( ) const

Definition at line 196 of file available.cpp.

197 {
198  return m_IsInstalled;
199 }

◆ RefreshAppInfo()

VOID CAvailableApplicationInfo::RefreshAppInfo ( )

Definition at line 28 of file available.cpp.

29 {
31  {
33  }
34 }
ATL::CStringW m_szUrlDownload
Definition: available.h:37
bool IsEmpty() const
Definition: atlsimpstr.h:379

◆ RetrieveGeneralInfo()

VOID CAvailableApplicationInfo::RetrieveGeneralInfo ( )
private

Definition at line 37 of file available.cpp.

38 {
40 
41  m_Parser->GetInt(L"Category", m_Category);
42 
43  if (!GetString(L"Name", m_szName)
44  || !GetString(L"URLDownload", m_szUrlDownload))
45  {
46  delete m_Parser;
47  return;
48  }
49 
50  GetString(L"RegName", m_szRegName);
51  GetString(L"Version", m_szVersion);
52  GetString(L"License", m_szLicense);
53  GetString(L"Description", m_szDesc);
54  GetString(L"URLSite", m_szUrlSite);
55  GetString(L"CDPath", m_szCDPath);
56  GetString(L"Language", m_szRegName);
57  GetString(L"SHA1", m_szSHA1);
58 
59  RetrieveSize();
63 
64  if (m_IsInstalled)
65  {
67  }
68 
69  delete m_Parser;
70 }
ATL::CStringW m_szRegName
Definition: available.h:31
ATL::CStringW m_szName
Definition: available.h:30
ATL::CStringW m_szVersion
Definition: available.h:32
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:395
ATL::CStringW m_szLicense
Definition: available.h:33
ATL::CStringW m_szDesc
Definition: available.h:34
static const WCHAR L[]
Definition: oid.c:1250
ATL::CStringW m_sFileName
Definition: available.h:42
ATL::CStringW m_szUrlDownload
Definition: available.h:37
ATL::CStringW m_szSHA1
Definition: available.h:46
ATL::CStringW m_szUrlSite
Definition: available.h:36
ATL::CStringW m_szCDPath
Definition: available.h:38
BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW &ReturnedString)
Definition: available.cpp:216
CConfigParser * m_Parser
Definition: available.h:68

Referenced by CAvailableApplicationInfo(), and RefreshAppInfo().

◆ RetrieveInstalledStatus()

VOID CAvailableApplicationInfo::RetrieveInstalledStatus ( )
private

Definition at line 72 of file available.cpp.

73 {
76 }
ATL::CStringW m_szRegName
Definition: available.h:31
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:316
ATL::CStringW m_szName
Definition: available.h:30
smooth NULL
Definition: ftsmooth.c:416

Referenced by RetrieveGeneralInfo().

◆ RetrieveInstalledVersion()

VOID CAvailableApplicationInfo::RetrieveInstalledVersion ( )
private

Definition at line 78 of file available.cpp.

79 {
80  ATL::CStringW szNameVersion;
81  szNameVersion = m_szName + L" " + m_szVersion;
84  || ::GetInstalledVersion(&m_szInstalledVersion, szNameVersion);
85 }
ATL::CStringW m_szRegName
Definition: available.h:31
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:316
ATL::CStringW m_szName
Definition: available.h:30
ATL::CStringW m_szVersion
Definition: available.h:32
static const WCHAR L[]
Definition: oid.c:1250
ATL::CStringW m_szInstalledVersion
Definition: available.h:47

Referenced by RetrieveGeneralInfo().

◆ RetrieveLanguages()

VOID CAvailableApplicationInfo::RetrieveLanguages ( )
private

Definition at line 87 of file available.cpp.

88 {
89  const WCHAR cDelimiter = L'|';
90  ATL::CStringW szBuffer;
91 
92  // TODO: Get multiline parameter
93  if (!m_Parser->GetString(L"Languages", szBuffer))
94  {
96  return;
97  }
98 
99  // Parse parameter string
100  ATL::CStringW m_szLocale;
101  INT iLCID;
102  for (INT i = 0; szBuffer[i] != UNICODE_NULL; ++i)
103  {
104  if (szBuffer[i] != cDelimiter && szBuffer[i] != L'\n')
105  {
106  m_szLocale += szBuffer[i];
107  }
108  else
109  {
110  if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
111  {
112  m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
113  m_szLocale.Empty();
114  }
115  }
116  }
117 
118  // For the text after delimiter
119  if (!m_szLocale.IsEmpty())
120  {
121  if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
122  {
123  m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
124  }
125  }
126 
128 }
#define TRUE
Definition: types.h:120
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define STIF_DEFAULT
Definition: shlwapi.h:1451
int32_t INT
Definition: typedefs.h:56
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 UNICODE_NULL
__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
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:357
ATL::CSimpleArray< LCID > m_LanguageLCIDs
Definition: available.h:39
CConfigParser * m_Parser
Definition: available.h:68

Referenced by RetrieveGeneralInfo().

◆ RetrieveLicenseType()

VOID CAvailableApplicationInfo::RetrieveLicenseType ( )
private

Definition at line 130 of file available.cpp.

131 {
132  INT IntBuffer;
133 
134  m_Parser->GetInt(L"LicenseType", IntBuffer);
135 
136  if (IsLicenseType(IntBuffer))
137  {
138  m_LicenseType = static_cast<LicenseType>(IntBuffer);
139  }
140  else
141  {
143  }
144 }
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:395
LicenseType m_LicenseType
Definition: available.h:29
BOOL IsLicenseType(INT x)
Definition: available.h:20
int32_t INT
Definition: typedefs.h:56
static const WCHAR L[]
Definition: oid.c:1250
CConfigParser * m_Parser
Definition: available.h:68

Referenced by RetrieveGeneralInfo().

◆ RetrieveSize()

VOID CAvailableApplicationInfo::RetrieveSize ( )
private

Definition at line 146 of file available.cpp.

147 {
148  INT iSizeBytes;
149 
150  if (!m_Parser->GetInt(L"SizeBytes", iSizeBytes))
151  {
152  // fall back to "Size" string
153  GetString(L"Size", m_szSize);
154  return;
155  }
156 
159 }
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2376
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:395
int32_t INT
Definition: typedefs.h:56
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
ATL::CStringW m_szSize
Definition: available.h:35
BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW &ReturnedString)
Definition: available.cpp:216
CConfigParser * m_Parser
Definition: available.h:68

Referenced by RetrieveGeneralInfo().

◆ SetLastWriteTime()

VOID CAvailableApplicationInfo::SetLastWriteTime ( FILETIME ftTime)

Definition at line 211 of file available.cpp.

212 {
213  RtlCopyMemory(&m_ftCacheStamp, ftTime, sizeof(FILETIME));
214 }
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 27 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_ftCacheStamp

FILETIME CAvailableApplicationInfo::m_ftCacheStamp

Definition at line 43 of file available.h.

Referenced by SetLastWriteTime().

◆ m_HasInstalledVersion

BOOL CAvailableApplicationInfo::m_HasInstalledVersion
private

Definition at line 67 of file available.h.

Referenced by HasInstalledVersion(), and RetrieveInstalledVersion().

◆ m_HasLanguageInfo

BOOL CAvailableApplicationInfo::m_HasLanguageInfo
private

Definition at line 66 of file available.h.

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

◆ m_IsInstalled

BOOL CAvailableApplicationInfo::m_IsInstalled
private

Definition at line 65 of file available.h.

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

◆ m_IsSelected

BOOL CAvailableApplicationInfo::m_IsSelected

Definition at line 28 of file available.h.

Referenced by CAppsListView::SetSelected().

◆ m_LanguageLCIDs

ATL::CSimpleArray<LCID> CAvailableApplicationInfo::m_LanguageLCIDs

Definition at line 39 of file available.h.

Referenced by FindInLanguages(), and RetrieveLanguages().

◆ m_LicenseType

LicenseType CAvailableApplicationInfo::m_LicenseType

Definition at line 29 of file available.h.

Referenced by RetrieveLicenseType().

◆ m_Parser

CConfigParser* CAvailableApplicationInfo::m_Parser
private

◆ m_sFileName

ATL::CStringW CAvailableApplicationInfo::m_sFileName

Definition at line 42 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szCDPath

ATL::CStringW CAvailableApplicationInfo::m_szCDPath

Definition at line 38 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szDesc

ATL::CStringW CAvailableApplicationInfo::m_szDesc

Definition at line 34 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szInstalledVersion

ATL::CStringW CAvailableApplicationInfo::m_szInstalledVersion

Definition at line 47 of file available.h.

Referenced by HasUpdate(), and RetrieveInstalledVersion().

◆ m_szLicense

ATL::CStringW CAvailableApplicationInfo::m_szLicense

Definition at line 33 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szName

ATL::CStringW CAvailableApplicationInfo::m_szName

◆ m_szRegName

ATL::CStringW CAvailableApplicationInfo::m_szRegName

◆ m_szSHA1

ATL::CStringW CAvailableApplicationInfo::m_szSHA1

Definition at line 46 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szSize

ATL::CStringW CAvailableApplicationInfo::m_szSize

Definition at line 35 of file available.h.

Referenced by RetrieveSize().

◆ m_szUrlDownload

ATL::CStringW CAvailableApplicationInfo::m_szUrlDownload

Definition at line 37 of file available.h.

Referenced by RefreshAppInfo(), and RetrieveGeneralInfo().

◆ m_szUrlSite

ATL::CStringW CAvailableApplicationInfo::m_szUrlSite

Definition at line 36 of file available.h.

Referenced by RetrieveGeneralInfo().

◆ m_szVersion

ATL::CStringW CAvailableApplicationInfo::m_szVersion

Definition at line 32 of file available.h.

Referenced by HasUpdate(), RetrieveGeneralInfo(), and RetrieveInstalledVersion().


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