15#include <rtl/ustring.hxx>
17#include <osl/mutex.hxx>
18#include <document.hxx>
20#include <rtl/strbuf.hxx>
26#include <orcus/csv_parser.hpp>
33class DataTransformation;
34class ExternalDataSource;
52 std::vector<std::shared_ptr<sc::DataTransformation>>&& mrDataTransformations);
60 virtual void execute()
override;
83 virtual const OUString&
GetURL()
const = 0;
85 static std::unique_ptr<SvStream>
FetchStreamFromURL(
const OUString&, OStringBuffer& rBuffer);
102 virtual void Import()
override;
104 const OUString&
GetURL()
const override;
const OUString & GetURL() const override
rtl::Reference< CSVFetchThread > mxCSVFetchThread
virtual ~CSVDataProvider() override
virtual void Import() override
ScDocumentUniquePtr mpDoc
CSVDataProvider(ScDocument *pDoc, sc::ExternalDataSource &rDataSource)
CSVFetchThread(ScDocument &rDoc, OUString, std::function< void()> aImportFinishedHdl, std::vector< std::shared_ptr< sc::DataTransformation > > &&mrDataTransformations)
std::vector< std::shared_ptr< sc::DataTransformation > > maDataTransformations
bool IsRequestedTerminate()
std::function< void()> maImportFinishedHdl
std::atomic< bool > mbTerminate
orcus::csv::parser_config maConfig
virtual ~CSVFetchThread() override
virtual void execute() override
static std::vector< OUString > getDataProviders()
static std::shared_ptr< DataProvider > getDataProvider(ScDocument *pDoc, sc::ExternalDataSource &rDataSource)
static bool isInternalDataProvider(std::u16string_view rProvider)
Abstract class for all data provider.
static std::unique_ptr< SvStream > FetchStreamFromURL(const OUString &, OStringBuffer &rBuffer)
bool mbDeterministic
If true make the threaded import deterministic for the tests.
DataProvider(sc::ExternalDataSource &rDataSource)
sc::ExternalDataSource & mrDataSource
virtual const OUString & GetURL() const =0
This class handles the copying of the data from the imported temporary document to the actual documen...
void WriteToDoc(ScDocument &rDoc)
void SetDatabase(const OUString &rDBName)
ScDBDataManager(OUString aDBName, ScDocument *pDoc)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
CAUTION! The following defines must be in the same namespace as the respective type.