Exemplo n.º 1
0
void SQLiteConfig::print( std::ostream& os, size_t indent ) const
{
	std::string indStr( indent, ' ' );

	os << indStr << configSection() << ":" << std::endl;
	if ( ! m_id.empty() )
		os << indStr << "   ID: " << m_id << std::endl;
	os << indStr << "   Filename: " << m_filename << std::endl;
	os << indStr << "      Referential integrity: " << (m_foreignKeys ? "enabled" : "disabled") << std::endl;
	os << indStr << "      Profiling: " << (m_profiling ? "enabled" : "disabled") << std::endl;
	os << indStr << "      Extension modules:";
	std::vector< std::string >::const_iterator it, end = m_extensionFiles.end( );
	for( it = m_extensionFiles.begin( ); it != end; it++ ) {
		os << indStr << "         " << *it << std::endl;
	}
}
Exemplo n.º 2
0
void PostgreSQLConfig::print( std::ostream& os, size_t indent ) const
{
	std::string indStr( indent, ' ' );

	os << indStr << sectionName() << ":" << std::endl;
	if ( ! m_ID.empty() )
		os << indStr << "   ID: " << m_ID << std::endl;
	if ( m_host.empty())
		os << indStr << "   Database host: local unix domain socket" << std::endl;
	else
		os << indStr << "   Database host: " << m_host << ":" << m_port << std::endl;
	os << indStr << "   Database name: " << (m_dbName.empty() ? "(not specified - server user default)" : m_dbName) << std::endl;
	os << indStr << "   Database user: "******"(not specified - same as server user)" : m_user)
	   << ", password: "******"(not specified - no password used)" : m_password) << std::endl;
	if ( ! m_sslMode.empty())
		os << indStr << "   Database connection SSL mode: " << m_sslMode << std::endl;
	if ( ! m_sslCert.empty())	{
		os << indStr << "   Client SSL certificate file: " << m_sslCert << std::endl;
		if ( ! m_sslMode.empty())
			os << indStr << "   Client SSL key file: " << m_sslKey << std::endl;
	}
	if ( ! m_sslRootCert.empty())
		os << indStr << "   SSL root CA file: " << m_sslRootCert << std::endl;
	if ( ! m_sslCRL.empty())
		os << indStr << "   SSL CRL file: " << m_sslCRL << std::endl;

	if ( m_connectTimeout == 0 )
		os << indStr << "   Connect timeout: 0 (wait indefinitely)" << std::endl;
	else
		os << indStr << "   Connect timeout: " << m_connectTimeout << "s" << std::endl;
	os << indStr << "   Database connections: " << m_connections << std::endl;
	if ( m_acquireTimeout == 0 )
		os << indStr << "   Acquire database connection timeout: 0 (wait indefinitely)" << std::endl;
	else
		os << indStr << "   Acquire database connection timeout: " << m_acquireTimeout << "s" << std::endl;
	if ( m_statementTimeout == 0 )
		os << indStr << "   Default statement execution timeout: 0 (wait indefinitely)" << std::endl;
	else
		os << indStr << "   Default statement execution timeout: " << m_statementTimeout << "ms" << std::endl;
}