ReactOS 0.4.15-dev-8241-g63935f8
CConfig Class Reference

#include <config.h>

Collaboration diagram for CConfig:

Public Member Functions

 CConfig ()
 
 ~CConfig ()
 
VOID Default ()
 
VOID Clear ()
 
BOOL Load ()
 
BOOL Save ()
 
LPWSTR GetMainBase ()
 
VOID SetMainBase (LPWSTR lpwsMainBase)
 
LPSTR GetHttpBase ()
 
VOID SetHttpBase (LPSTR lpsHttpBase)
 
CList< LPSTR > * GetDefaultResources ()
 
USHORT GetPort ()
 
VOID SetPort (USHORT wPort)
 

Private Member Functions

VOID Reset ()
 

Private Attributes

LPWSTR MainBase
 
LPSTR HttpBase
 
CList< LPSTRDefaultResources
 
USHORT Port
 

Detailed Description

Definition at line 22 of file config.h.

Constructor & Destructor Documentation

◆ CConfig()

CConfig::CConfig ( )

Definition at line 22 of file config.cpp.

23{
24 Reset();
25}
VOID Reset()
Definition: config.cpp:34

◆ ~CConfig()

CConfig::~CConfig ( )

Definition at line 28 of file config.cpp.

29{
30 Clear();
31}
VOID Clear()
Definition: config.cpp:62

Member Function Documentation

◆ Clear()

void CConfig::Clear ( )

Definition at line 62 of file config.cpp.

63{
64 if (MainBase != NULL)
65 free((void *)MainBase);
66 if (HttpBase != NULL)
67 free((void *)HttpBase);
68
69 // Free memory for all strings
71 for (i->First(); !i->IsDone(); i->Next())
72 free((void *)i->CurrentItem());
73 delete i;
74
75 Reset();
76}
LPSTR HttpBase
Definition: config.h:40
LPWSTR MainBase
Definition: config.h:39
CList< LPSTR > DefaultResources
Definition: config.h:41
CIterator< Item > * CreateIterator() const
Definition: list.h:93
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
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

Referenced by Default(), and ~CConfig().

◆ Default()

void CConfig::Default ( )

Definition at line 42 of file config.cpp.

43{
44 Clear();
47
48 LPSTR lpsStr;
49 try {
52 } catch (bad_alloc&) {
53 free((void *)lpsStr);
54 Clear();
55 throw;
56 }
57
59}
USHORT Port
Definition: config.h:42
VOID Insert(Item &element)
Definition: list.h:123
#define _strdup
Definition: debug_ros.c:7
#define dcfgDefaultPort
Definition: config.h:20
#define dcfgMainBase
Definition: config.h:17
#define dcfgDefaultResource
Definition: config.h:19
#define dcfgHttpBase
Definition: config.h:18
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by Load(), and Run().

◆ GetDefaultResources()

CList< LPSTR > * CConfig::GetDefaultResources ( )

Definition at line 116 of file config.cpp.

117{
118 return &DefaultResources;
119}

Referenced by CHttpClient::ProcessRequest().

◆ GetHttpBase()

LPSTR CConfig::GetHttpBase ( )

Definition at line 104 of file config.cpp.

105{
106 return HttpBase;
107}

Referenced by CHttpClient::ProcessRequest().

◆ GetMainBase()

LPWSTR CConfig::GetMainBase ( )

Definition at line 92 of file config.cpp.

93{
94 return MainBase;
95}

◆ GetPort()

USHORT CConfig::GetPort ( )

Definition at line 122 of file config.cpp.

123{
124 return Port;
125}

Referenced by CHttpDaemon::Start().

◆ Load()

BOOL CConfig::Load ( )

Definition at line 79 of file config.cpp.

80{
81 Default();
82 return TRUE;
83}
VOID Default()
Definition: config.cpp:42
#define TRUE
Definition: types.h:120

◆ Reset()

void CConfig::Reset ( )
private

Definition at line 34 of file config.cpp.

35{
36 MainBase = NULL;
37 HttpBase = NULL;
39}
VOID RemoveAll()
Definition: list.h:150

Referenced by CConfig(), and Clear().

◆ Save()

BOOL CConfig::Save ( )

Definition at line 86 of file config.cpp.

87{
88 return TRUE;
89}

◆ SetHttpBase()

void CConfig::SetHttpBase ( LPSTR  lpsHttpBase)

Definition at line 110 of file config.cpp.

111{
112 HttpBase = lpsHttpBase;
113}

◆ SetMainBase()

void CConfig::SetMainBase ( LPWSTR  lpwsMainBase)

Definition at line 98 of file config.cpp.

99{
100 MainBase = lpwsMainBase;
101}

◆ SetPort()

VOID CConfig::SetPort ( USHORT  wPort)

Definition at line 128 of file config.cpp.

129{
130 Port = wPort;
131}

Member Data Documentation

◆ DefaultResources

CList<LPSTR> CConfig::DefaultResources
private

Definition at line 41 of file config.h.

Referenced by Clear(), Default(), GetDefaultResources(), and Reset().

◆ HttpBase

LPSTR CConfig::HttpBase
private

Definition at line 40 of file config.h.

Referenced by Clear(), Default(), GetHttpBase(), Reset(), and SetHttpBase().

◆ MainBase

LPWSTR CConfig::MainBase
private

Definition at line 39 of file config.h.

Referenced by Clear(), Default(), GetMainBase(), Reset(), and SetMainBase().

◆ Port

USHORT CConfig::Port
private

Definition at line 42 of file config.h.

Referenced by Default(), GetPort(), and SetPort().


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