ReactOS  0.4.15-dev-2153-g62b4c61
CFontInfo Class Reference

#include <CFontCache.hpp>

Public Member Functions

 CFontInfo (LPCWSTR name=L"")
 
const CStringWName () const
 
const CStringWFile ()
 
const bool Valid () const
 

Private Attributes

CStringW m_Name
 
CStringW m_File
 
bool m_FileRead
 

Detailed Description

Definition at line 11 of file CFontCache.hpp.

Constructor & Destructor Documentation

◆ CFontInfo()

CFontInfo::CFontInfo ( LPCWSTR  name = L"")

Definition at line 14 of file CFontCache.cpp.

15  : m_Name(name)
16  , m_FileRead(false)
17 {
18 }
CStringW m_Name
Definition: CFontCache.hpp:14
bool m_FileRead
Definition: CFontCache.hpp:16
Definition: name.c:38

Member Function Documentation

◆ File()

const CStringW & CFontInfo::File ( )

Definition at line 30 of file CFontCache.cpp.

31 {
32  if (!m_FileRead)
33  {
34  if (Valid())
35  {
36  // Read the filename stored in the registry.
37  // This can be either a filename or a full path
38  CRegKey key;
40  {
42  DWORD dwAllocated = 128;
44  do
45  {
46  DWORD dwSize = dwAllocated;
47  PWSTR Buffer = Value.GetBuffer(dwSize);
48  Status = key.QueryStringValue(m_Name, Buffer, &dwSize);
49  Value.ReleaseBuffer(dwSize);
50  if (Status == ERROR_SUCCESS)
51  {
52  // Ensure we do not re-use the same string object, by passing it a PCWSTR
54  break;
55  }
56  dwAllocated += 128;
57  } while (Status == ERROR_MORE_DATA);
58  }
59  }
60  m_FileRead = true;
61  }
62  return m_File;
63 }
CStringW m_File
Definition: CFontCache.hpp:15
#define ERROR_SUCCESS
Definition: deptool.c:10
const bool Valid() const
Definition: CFontCache.cpp:25
CStringW m_Name
Definition: CFontCache.hpp:14
#define KEY_READ
Definition: nt_native.h:1023
uint16_t * PWSTR
Definition: typedefs.h:56
#define FONT_KEY
Definition: precomp.h:31
Definition: bufpool.h:45
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
Status
Definition: gdiplustypes.h:24
#define FONT_HIVE
Definition: precomp.h:30
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned long DWORD
Definition: ntddk_ex.h:95
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
HKEY key
Definition: reg.c:42
#define ERROR_MORE_DATA
Definition: dderror.h:13
bool m_FileRead
Definition: CFontCache.hpp:16
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
Definition: path.c:41

◆ Name()

const CStringW & CFontInfo::Name ( ) const

Definition at line 20 of file CFontCache.cpp.

21 {
22  return m_Name;
23 }
CStringW m_Name
Definition: CFontCache.hpp:14

◆ Valid()

const bool CFontInfo::Valid ( ) const

Definition at line 25 of file CFontCache.cpp.

26 {
27  return !m_Name.IsEmpty();
28 }
CStringW m_Name
Definition: CFontCache.hpp:14
bool IsEmpty() const
Definition: atlsimpstr.h:379

Referenced by File().

Member Data Documentation

◆ m_File

CStringW CFontInfo::m_File
private

Definition at line 15 of file CFontCache.hpp.

Referenced by File().

◆ m_FileRead

bool CFontInfo::m_FileRead
private

Definition at line 16 of file CFontCache.hpp.

Referenced by File().

◆ m_Name

CStringW CFontInfo::m_Name
private

Definition at line 14 of file CFontCache.hpp.

Referenced by File(), Name(), and Valid().


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