src/DriverManager.h
author František Kučera <franta-hg@frantovo.cz>
Mon, 25 May 2020 19:36:06 +0200
branchv_0
changeset 34 24c05e69d68f
child 36 91cb012d779a
permissions -rw-r--r--
add ODBC library and --list-data-sources mode (DSN)

/**
 * Relational pipes
 * Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once

#include <vector>
#include <codecvt>
#include <locale>

#include <relpipe/reader/typedefs.h>

#include "SqlException.h"

namespace relpipe {
namespace tr {
namespace sql {

class DriverManager {
private:
	void* env;
	std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings

public:

	class DataSource {
	public:
		relpipe::reader::string_t name;
		relpipe::reader::string_t description;
	};

	DriverManager();
	virtual ~DriverManager();
	std::vector<DataSource> getDataSources();
};

}
}
}