OLD | NEW |
(Empty) | |
| 1 /** |
| 2 * \file session.h The "install session" is the context for all custom installat
ion behavior. |
| 3 */ |
| 4 |
| 5 #ifndef RECORD_H |
| 6 #define RECORD_H |
| 7 |
| 8 #include <string> |
| 9 #include "windows.h" |
| 10 #include "msi.h" |
| 11 |
| 12 /** |
| 13 * An abstract record entity. |
| 14 * It represents both records in the installation database and as argument vecto
rs for API functions. |
| 15 * |
| 16 * The ordinary constructor creates a free-standing record. |
| 17 * It takes only the number of fields in the created record. |
| 18 * The fields of the record are dynamically typed according to how they're assig
ned. |
| 19 * |
| 20 * Other constructors encapsulate records that are bound to databases. |
| 21 * |
| 22 * \par Invariant |
| 23 * - _handle is not null |
| 24 * - _handle is represents an open record obtained from MsiCreateRecord |
| 25 * |
| 26 * \sa http://msdn.microsoft.com/en-us/library/windows/desktop/aa372881%28v=vs.8
5%29.aspx |
| 27 * Windows Installer on MSDN: "Working with Records" |
| 28 */ |
| 29 class Record { |
| 30 public: |
| 31 /** |
| 32 * Ordinary constructor creates a free-standing record. |
| 33 * Use this for creating argument vectors. |
| 34 * |
| 35 * \param[in] n_fields |
| 36 * Number of fields in the created record. |
| 37 */ |
| 38 Record( unsigned int n_fields ) ; |
| 39 |
| 40 /** |
| 41 * Destructor |
| 42 */ |
| 43 ~Record() ; |
| 44 |
| 45 /** |
| 46 * Assign a string to a record |
| 47 * |
| 48 * \param[in] field_index |
| 49 * Index into the record as a vector of fields |
| 50 * \param[in] value |
| 51 * String to write into the field |
| 52 */ |
| 53 void assign_string( unsigned int field_index, std::wstring value ) ; |
| 54 |
| 55 /** |
| 56 * Handle accessor. |
| 57 */ |
| 58 MSIHANDLE handle() { return _handle ; } |
| 59 |
| 60 private: |
| 61 /** |
| 62 * The handle for the record as a Windows Installer resource. |
| 63 */ |
| 64 MSIHANDLE _handle ; |
| 65 |
| 66 /** |
| 67 * The number of fields in the record. |
| 68 */ |
| 69 unsigned int n_fields ; |
| 70 }; |
| 71 |
| 72 #endif |
OLD | NEW |