19#include <orcus/csv_parser.hpp>
35 static void begin_parse() {}
36 static void end_parse() {}
37 static void begin_row() {}
44 void cell(std::string_view s,
bool )
67 ScDocument& rDoc, OUString aURL, std::function<
void()> aImportFinishedHdl,
68 std::vector<std::shared_ptr<sc::DataTransformation>>&& rDataTransformations)
69 : Thread(
"CSV Fetch Thread")
73 , maDataTransformations(
std::move(rDataTransformations))
74 , maImportFinishedHdl(
std::move(aImportFinishedHdl))
void SetDocumentModified()
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
SfxObjectShell * GetDocumentShell() const
static bool parseSimpleNumber(const OUString &rStr, sal_Unicode dsep, sal_Unicode gsep, sal_Unicode dsepa, double &rVal, bool bDetectScientificNumber=true)
Check if a given string is a simple decimal number (e.g.
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
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.
sc::ExternalDataSource & mrDataSource
const std::vector< std::shared_ptr< sc::DataTransformation > > & getDataTransformation() const
const OUString & getURL() const
ScDBDataManager * getDBManager()
void WriteToDoc(ScDocument &rDoc)
CAUTION! The following defines must be in the same namespace as the respective type.
std::unique_ptr< char[]> aBuffer