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

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

Issue 29329159: Issue #1185 - Fix formatting in installer-lib and its tests (Closed)
Patch Set: Created Oct. 15, 2015, 7:03 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
« no previous file with comments | « installer/src/installer-lib/database.h ('k') | installer/src/installer-lib/handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: installer/src/installer-lib/database.cpp
===================================================================
--- a/installer/src/installer-lib/database.cpp
+++ b/installer/src/installer-lib/database.cpp
@@ -8,19 +8,19 @@
//-----------------------------------------------------------------------------------------
// Database
//-----------------------------------------------------------------------------------------
-MsiHandle Database::OpenView( const wchar_t * query )
+MsiHandle Database::OpenView(const wchar_t* query)
{
- MSIHANDLE viewHandle ;
- UINT x = MsiDatabaseOpenView( handle, query, & viewHandle ) ;
- if ( x == ERROR_BAD_QUERY_SYNTAX )
+ MSIHANDLE viewHandle;
+ UINT x = MsiDatabaseOpenView(handle, query, & viewHandle);
+ if (x == ERROR_BAD_QUERY_SYNTAX)
{
- throw WindowsApiError( "MsiDatabaseOpenView", "ERROR_BAD_QUERY_SYNTAX" ) ;
+ throw WindowsApiError("MsiDatabaseOpenView", "ERROR_BAD_QUERY_SYNTAX");
}
- else if ( x == ERROR_INVALID_HANDLE )
+ else if (x == ERROR_INVALID_HANDLE)
{
- throw WindowsApiError( "MsiDatabaseOpenView", "ERROR_INVALID_HANDLE" ) ;
+ throw WindowsApiError("MsiDatabaseOpenView", "ERROR_INVALID_HANDLE");
}
- return MsiHandle( viewHandle ) ;
+ return MsiHandle(viewHandle);
}
//-----------------------------------------------------------------------------------------
@@ -34,25 +34,25 @@
* Return value of this function, a handle, must be released in order to avoid a resource leak.
* Passing it as an argument to the Database constructor is adequate.
*/
-MsiHandle GetActiveDatabase( ImmediateSession & session )
+MsiHandle GetActiveDatabase(ImmediateSession& session)
{
- MSIHANDLE h( MsiGetActiveDatabase( session.handle ) ) ;
- if ( h == 0 )
+ MSIHANDLE h(MsiGetActiveDatabase(session.handle));
+ if (h == 0)
{
- throw WindowsApiError( "MsiGetActiveDatabase", 0 ) ;
+ throw WindowsApiError("MsiGetActiveDatabase", 0);
}
- return MsiHandle( h ) ;
+ return MsiHandle(h);
}
/**
* \par Implementation Notes
* The only thing this constructor needs to do is to initialize the base class.
*/
-InstallationDatabase::InstallationDatabase( ImmediateSession & session )
- : Database( GetActiveDatabase( session ) )
+InstallationDatabase::InstallationDatabase(ImmediateSession& session)
+ : Database(GetActiveDatabase(session))
{
// empty body
-} ;
+};
//-----------------------------------------------------------------------------------------
// View
@@ -60,38 +60,38 @@
/**
* Implementation function for View::First().
*/
-void ViewFirstBody( UINT x )
+void ViewFirstBody(UINT x)
{
- if ( x != ERROR_SUCCESS )
+ if (x != ERROR_SUCCESS)
{
- throw WindowsApiError( "MsiViewExecute", x ) ;
+ throw WindowsApiError("MsiViewExecute", x);
}
}
Record View::First()
{
- ViewFirstBody( MsiViewExecute( handle, 0 ) ) ;
- return Next() ;
+ ViewFirstBody(MsiViewExecute(handle, 0));
+ return Next();
}
-Record View::First( Record & arguments )
+Record View::First(Record& arguments)
{
- ViewFirstBody( MsiViewExecute( handle, arguments.handle ) ) ;
- return Next() ;
+ ViewFirstBody(MsiViewExecute(handle, arguments.handle));
+ return Next();
}
Record View::Next()
{
- MSIHANDLE h ;
- UINT x = MsiViewFetch( handle, & h ) ;
- if ( x == ERROR_NO_MORE_ITEMS )
+ MSIHANDLE h;
+ UINT x = MsiViewFetch(handle, & h);
+ if (x == ERROR_NO_MORE_ITEMS)
{
- return Record( Record::NullType() ) ;
+ return Record(Record::NullType());
}
- else if ( x == ERROR_SUCCESS )
+ else if (x == ERROR_SUCCESS)
{
- return Record( MsiHandle( h ) ) ;
+ return Record(MsiHandle(h));
}
- throw WindowsApiError( "MsiViewFetch", x ) ;
+ throw WindowsApiError("MsiViewFetch", x);
}
« no previous file with comments | « installer/src/installer-lib/database.h ('k') | installer/src/installer-lib/handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld