Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
dmlc::data::CSVParser< IndexType, DType > Class Template Reference

CSVParser, parses a dense csv format. All columns are treated as real dense data. Label will be empty if the label column is not specified. More...

#include <csv_parser.h>

Inheritance diagram for dmlc::data::CSVParser< IndexType, DType >:
dmlc::data::TextParserBase< IndexType, DType > dmlc::data::ParserImpl< IndexType, DType > dmlc::Parser< IndexType, DType > dmlc::DataIter< DType > parser_test::CSVParserTest< IndexType, DType >

Public Member Functions

 CSVParser (InputSplit *source, const std::map< std::string, std::string > &args, int nthread)
 
- Public Member Functions inherited from dmlc::data::TextParserBase< IndexType, DType >
 TextParserBase (InputSplit *source, int nthread)
 
virtual void BeforeFirst (void)
 set before first of the item
 
virtual size_t BytesRead (void) const
 
virtual bool ParseNext (std::vector< RowBlockContainer< IndexType, DType > > *data)
 read in next several blocks of data
 
- Public Member Functions inherited from dmlc::data::ParserImpl< IndexType, DType >
virtual bool Next (void)
 implement next
 
virtual const RowBlock< IndexType, DType > & Value (void) const
 get current data
 
- Public Member Functions inherited from dmlc::Parser< IndexType, DType >
Parser< uint32_t, real_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
Parser< uint64_t, real_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
Parser< uint32_t, int32_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
Parser< uint64_t, int32_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
Parser< uint32_t, int64_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
Parser< uint64_t, int64_t > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 
- Public Member Functions inherited from dmlc::DataIter< DType >
virtual ~DataIter (void) DMLC_THROW_EXCEPTION
 destructor
 

Protected Member Functions

virtual void ParseBlock (const char *begin, const char *end, RowBlockContainer< IndexType, DType > *out)
 parse data into out
 
- Protected Member Functions inherited from dmlc::data::TextParserBase< IndexType, DType >
bool FillData (std::vector< RowBlockContainer< IndexType, DType > > *data)
 read in next several blocks of data
 

Additional Inherited Members

- Public Types inherited from dmlc::Parser< IndexType, DType >
typedef Parser< IndexType, DType > *(* Factory) (const std::string &path, const std::map< std::string, std::string > &args, unsigned part_index, unsigned num_parts)
 Factory type of the parser.
 
- Static Public Member Functions inherited from dmlc::Parser< IndexType, DType >
static Parser< IndexType, DType > * Create (const char *uri_, unsigned part_index, unsigned num_parts, const char *type)
 create a new instance of parser based on the "type"
 
- Static Protected Member Functions inherited from dmlc::data::TextParserBase< IndexType, DType >
static const char * BackFindEndLine (const char *bptr, const char *begin)
 start from bptr, go backward and find first endof line
 
static void IgnoreUTF8BOM (const char **begin, const char **end)
 Ignore UTF-8 BOM if present.
 
- Protected Attributes inherited from dmlc::data::ParserImpl< IndexType, DType >
IndexType data_ptr_
 pointer to begin and end of data
 
IndexType data_end_
 
std::vector< RowBlockContainer< IndexType, DType > > data_
 internal data
 
RowBlock< IndexType, DType > block_
 internal row block
 

Detailed Description

template<typename IndexType, typename DType = real_t>
class dmlc::data::CSVParser< IndexType, DType >

CSVParser, parses a dense csv format. All columns are treated as real dense data. Label will be empty if the label column is not specified.

This should be extended in future to accept arguments of column types.

Member Function Documentation

◆ ParseBlock()

template<typename IndexType , typename DType >
void dmlc::data::CSVParser< IndexType, DType >::ParseBlock ( const char *  begin,
const char *  end,
RowBlockContainer< IndexType, DType > *  out 
)
protectedvirtual

parse data into out

Parameters
beginbeginning of buffer
endend of buffer

Implements dmlc::data::TextParserBase< IndexType, DType >.


The documentation for this class was generated from the following file: