Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: installer/src/installer-lib/record.cpp

Issue 22887001: Custom action library, initial version (Closed)
Patch Set: Created Oct. 28, 2013, 9:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: installer/src/installer-lib/record.cpp
===================================================================
new file mode 100644
--- /dev/null
+++ b/installer/src/installer-lib/record.cpp
@@ -0,0 +1,30 @@
+/**
+ * \file record.cpp Implementation of Session class.
Wladimir Palant 2013/10/29 08:49:26 Nope, it's the Record class ;) Generally, I'm uns
Eric 2013/10/29 14:00:58 Oops. Bad copypasta.
Wladimir Palant 2013/10/29 15:06:38 Well, these handles just don't need to be wrapped
+ */
+
+#include "record.h"
+#include "msiquery.h"
+
+//-----------------------------------------------------------------------------------------
+// Record
+//-----------------------------------------------------------------------------------------
+Record::Record( unsigned int n_fields )
+ : n_fields( n_fields )
+{
+ _handle = MsiCreateRecord( n_fields ) ;
+ if ( ! _handle )
+ {
+ throw std::runtime_error( "Failed to create record" ) ;
+ }
+}
+
+Record::~Record()
+{
+ MsiCloseHandle( _handle ) ;
+}
+
+void
+Record::assign_string( unsigned int field_index, std::wstring value )
+{
+ MsiRecordSetString( _handle, field_index, value.c_str() ) ;
+}

Powered by Google App Engine
This is Rietveld