src/Common/ODBC/MSSQLDatabase.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 namespace AppSecInc
00004 {
00005         namespace Databases
00006         {
00007                 namespace MSSQL
00008                 {
00010             class MSSQLDatabase : public AppSecInc::Databases::ODBC::ODBCDatabase
00011                         {
00012             private:
00013                 std::list<MSSQLDatabaseFileSpec> _filespecs;
00014                 std::list<std::wstring> _database_options;
00015                 std::wstring _database_collate;
00016                 std::wstring _database_purpose;
00017                 AppSecInc::Databases::ODBC::ODBCConnection _connection;
00018                 std::wstring _connection_string;
00019                 std::wstring _database_name;
00020                 MSSQLDatabase& operator=(const MSSQLDatabase&);
00021             public:
00023                 const std::wstring GetName() const { return _database_name; }
00025                 void SetName(const std::wstring& value) { _database_name = value; }
00027                 const std::wstring GetCollate() const { return _database_collate; }
00029                 void SetCollate(const std::wstring& value) { _database_collate = value; }
00031                 const std::wstring GetPurpose() const { return _database_purpose; }
00033                 void SetPurpose(const std::wstring& value) { _database_purpose = value; }
00035                 const std::list<MSSQLDatabaseFileSpec>& GetFileSpecs() const { return _filespecs; }
00037                 void AddFileSpec(const MSSQLDatabaseFileSpec& value) { _filespecs.push_back(value); }
00039                 const std::list<std::wstring>& GetOptions() const { return _database_options; }
00041                 void AddOption(const std::wstring& value) { _database_options.push_back(value); }
00043                 AppSecInc::Databases::ODBC::ODBCConnection& GetConnection() { return _connection; }
00044                 const AppSecInc::Databases::ODBC::ODBCConnection& GetConnection() const { return _connection; }
00045                         public:
00047                 MSSQLDatabase();
00048                 MSSQLDatabase(const AppSecInc::Databases::ODBC::ODBCConnectionInfo& connectioninfo);
00049                 void Create();
00050                 bool Exists();
00051                 void Connect();
00052                 void Disconnect();
00053                 void Drop();
00054                 void CreateIfNotExists();
00055                 void DropIfExists();
00056                                 ~MSSQLDatabase();
00057                 std::wstring GetCreateQuery() const;
00058                                 std::vector<std::wstring> GetOptionQueries() const;
00059                 std::wstring GetDropQuery() const;
00060                 std::wstring GetExistsQuery() const;
00061                 std::wstring GetNotExistsQuery() const;
00063                 MSXML2::IXMLDOMNodePtr Save(AppSecInc::Xml::XmlDocument& xmldoc, MSXML2::IXMLDOMNodePtr parent) const;
00065                 void Load(AppSecInc::Xml::XmlDocument& xmldoc, MSXML2::IXMLDOMNodePtr root);
00066                         };
00067                 }
00068         }
00069 }


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com