Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
4.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AnswerFile.h
  7. //
  8. // Abstract:
  9. // This is the class definition file for the CAnswerFileSection class and its'
  10. // contained classes.
  11. //
  12. // Author:
  13. // C. Brent Thomas - a-brentt
  14. //
  15. // Revision History:
  16. //
  17. // 24-Sep-1998 original
  18. //
  19. // Notes:
  20. //
  21. // The classes defined in this file include:
  22. //
  23. // CAnswerFileSection
  24. // CAnswerFileEntry
  25. // CParameterListEntry
  26. //
  27. // I consciously chose not to use MFC because I expect cluster setup to
  28. // move away from MFC (probably to ATL) when it gets rewritten.
  29. //
  30. /////////////////////////////////////////////////////////////////////////////
  31. #ifndef __ANSWERFILE_H_
  32. #define __ANSWERFILE_H_
  33. // CParameterListEntry class
  34. //
  35. // An object of this class corresponds to a parameter on an entry in an answer file.
  36. // It is implemented as a singly linked list of pointers to arrays of type TCHAR.
  37. class CParameterListEntry
  38. {
  39. public:
  40. CParameterListEntry(); // constructor
  41. ~CParameterListEntry(); // destructor
  42. // Data members
  43. private:
  44. LPTSTR m_ptszParameter; // points to the parameter string
  45. CParameterListEntry * m_pNextParameter; // points to the next parameter list entry
  46. // Member functions
  47. public:
  48. BOOL SetParameterString( LPTSTR ptszParameterString );
  49. BOOL SetNextParameterPointer( CParameterListEntry * pParameterListEntry );
  50. CParameterListEntry * GetParameterListPointer( void );
  51. LPTSTR GetParameterStringPointer( void );
  52. private:
  53. };
  54. // CAnswerFileEntry class definition
  55. //
  56. // An object of this class corresponds to an entry in an answer file.
  57. class CAnswerFileEntry
  58. {
  59. public:
  60. CAnswerFileEntry(); // constructor
  61. ~CAnswerFileEntry(); // destructor
  62. // Data members
  63. private:
  64. CAnswerFileEntry * m_pNextEntry; // points to the next CAnswerFileEntry object
  65. // in the list.
  66. LPTSTR m_ptszKey; // points to the key string for this
  67. // answer file entry
  68. CParameterListEntry * m_pParameterList; // points to the parameter list for
  69. // this answer file (may be empty)
  70. int m_xParameterCount; // the number of parameters that may
  71. // be present (on initialization) or
  72. // the number of parameters found (after
  73. // the parameter list has been read)
  74. // Member functions
  75. public:
  76. BOOL SetKey( LPTSTR ptszKey );
  77. BOOL ReadParameters( PINFCONTEXT pAnswerFileContext );
  78. BOOL SetNextEntryPointer( CAnswerFileEntry * pEntry );
  79. CAnswerFileEntry * GetNextEntryPointer( void );
  80. LPTSTR GetKeyPointer( void );
  81. CParameterListEntry * GetParameterListPointer( void );
  82. int GetParameterCount( void );
  83. private:
  84. BOOL SetParameterListPointer( CParameterListEntry * pParameterList );
  85. BOOL SetParameterCount( int xParameterCount );
  86. }; // class CAnswerFileEntry
  87. // CAnswerFileSection class definition
  88. //
  89. // An object of this class corresponds to a section in an answer file.
  90. class CAnswerFileSection
  91. {
  92. public:
  93. CAnswerFileSection(); // constructor
  94. ~CAnswerFileSection(); // destructor
  95. // Data members
  96. private:
  97. CAnswerFileEntry * m_pEntries; // points to the entries in the answer file section
  98. int m_xCurrentRequiredParameterCount;
  99. int m_xCurrentOptionalParameterCount;
  100. // Member functions
  101. public:
  102. CAnswerFileEntry * GetEntryPointer( void );
  103. BOOL ReadAnswerFileSection( HINF hAnswerFile,
  104. LPTSTR ptszSection );
  105. }; // class CAnswerFileSection
  106. #endif // __ANSWERFILE_H_