%{ #include "Model/DDirectory.h" #include "Providers/DDataProvider.h" #include "Providers/DMySQLDataProvider.h" using namespace ccdb; using namespace std; %} class DDataProvider: public DObjectsOwner { public: DDataProvider(void); virtual ~DDataProvider(void); //---------------------------------------------------------------------------------------- // C O N N E C T I O N //---------------------------------------------------------------------------------------- /** * @brief Connects to database using connection string * * Connects to database using connection string * connection string might be in form: * mysql://:@: * * @param connectionString "mysql://:@: " * @return true if connected */ virtual bool Connect(std::string connectionString) = 0; /** * @brief closes connection to data */ virtual void Disconnect()= 0; /** * @brief indicates ether the connection is open or not * * @return true if connection is open */ virtual bool IsConnected()=0; //---------------------------------------------------------------------------------------- // D I R E C T O R Y M A N G E M E N T //---------------------------------------------------------------------------------------- /** @brief Gets directory by its full path * * @param Full path of the directory * @return DDirectory object if directory exists, NULL otherwise */ virtual DDirectory* GetDirectory(const std::string& path)=0; }; %feature("notabstract") DMySQLDataProvider; class DMySQLDataProvider: public DDataProvider { public: DMySQLDataProvider(void); virtual ~DMySQLDataProvider(void); //---------------------------------------------------------------------------------------- // C O N N E C T I O N //---------------------------------------------------------------------------------------- /** * @brief Connects to database using connection string * * Connects to database using connection string * connection string might be in form: * mysql://:@: * * @param connectionString "mysql://:@: " * @return true if connected */ virtual bool Connect(std::string connectionString); /** * @brief indicates ether the connection is open or not * * @return true if connection is open */ virtual bool IsConnected(); /** * @brief closes connection to data */ virtual void Disconnect(); //---------------------------------------------------------------------------------------- // D I R E C T O R Y M A N G E M E N T //---------------------------------------------------------------------------------------- /** @brief Gets directory by its full path * * @param Full path of the directory * @return DDirectory object if directory exists, NULL otherwise */ virtual DDirectory* GetDirectory(const std::string& path); };