📄 reader.cpp
字号:
#include "Reader.hpp"#include <fstream>using namespace indii::ml::data;Reader::Reader(std::istream* in) : in(in), ownStream(false) { //}Reader::Reader(const std::string& file) : ownStream(true) { in = new std::ifstream(file.c_str());}Reader::Reader(std::istream* in, unsigned int col) : in(in), ownStream(false) { cols.push_back(col);}Reader::Reader(const std::string& file, unsigned int col) : ownStream(true) { in = new std::ifstream(file.c_str()); cols.push_back(col);}Reader::Reader(std::istream* in, const std::vector<unsigned int>& cols) : in(in), cols(cols), ownStream(false) { //}Reader::Reader(const std::string& file, const std::vector<unsigned int>& cols) : cols(cols), ownStream(true) { in = new std::ifstream(file.c_str());}Reader::~Reader() { if (ownStream) { static_cast<std::ifstream*>(in)->close(); delete in; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -