src/DriverManager.h
branchv_0
changeset 37 3de41719d7eb
parent 36 91cb012d779a
child 47 428c278af4be
equal deleted inserted replaced
36:91cb012d779a 37:3de41719d7eb
    37  *    Wrapping it immediatelly in a smart pointer is a convenient way to manage its lifecycle.
    37  *    Wrapping it immediatelly in a smart pointer is a convenient way to manage its lifecycle.
    38  *    Statements should be destroyed before the Connection. And Connection should be destroyed before DriverManager.
    38  *    Statements should be destroyed before the Connection. And Connection should be destroyed before DriverManager.
    39  */
    39  */
    40 class DriverManager {
    40 class DriverManager {
    41 private:
    41 private:
    42 	void* env;
    42 	void* environment;
    43 	std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings
    43 	std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings
    44 
    44 
    45 public:
    45 public:
    46 
    46 
    47 	class DataSource {
    47 	class DataSource {
    52 
    52 
    53 	DriverManager();
    53 	DriverManager();
    54 	virtual ~DriverManager();
    54 	virtual ~DriverManager();
    55 	std::vector<DataSource> getDataSources();
    55 	std::vector<DataSource> getDataSources();
    56 	Connection* getConnectionByDSN(relpipe::reader::string_t dataSourceName, relpipe::reader::string_t userName = L"", relpipe::reader::string_t password = L"");
    56 	Connection* getConnectionByDSN(relpipe::reader::string_t dataSourceName, relpipe::reader::string_t userName = L"", relpipe::reader::string_t password = L"");
    57 	Connection* getConnectionByString(relpipe::reader::string_t connectionString);
    57 	Connection* getConnectionByURL(relpipe::reader::string_t connectionString);
    58 	relpipe::reader::string_t buildDSN(const std::map<relpipe::reader::string_t, relpipe::reader::string_t>& parameters);
       
    59 };
    58 };
    60 
    59 
    61 }
    60 }
    62 }
    61 }
    63 }
    62 }