You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/Module/GeoSigmaDraw/StreamingTsvStream.h

33 lines
849 B
C

1 month ago
#pragma once
#include "stdafx.h"
#include "NativeStream.h"
#include "StreamingTsvParser.h"
#include "TableDataImporter.h"
#include <map>
#include <memory>
#include <vector>
/**
* @brief TSV Write
*/
class StreamingTsvStream : public INativeStream
{
public:
StreamingTsvStream(CSigmaView* pView, int importType);
void Write(const void* data, size_t size) override;
void Complete() override;
private:
void OnParsedLine(int lineIndex, const std::vector<std::string>& fields);
std::vector<CString> FieldsToCString(const std::vector<std::string>& fields);
StreamingTsvParser m_parser;
CSigmaView* m_pView = nullptr;
int m_importType = 0;
std::map<CString, int> m_columnIndexMap;
std::unique_ptr<CurveStreamImporter> m_curveImporter;
bool m_headersReady = false;
};