aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
CSVParser_inl.h
Go to the documentation of this file.
1
20
#pragma once
21
22
#include <
agrum/base/database/CSVParser.h
>
// to ease IDE parser
23
#ifndef DOXYGEN_SHOULD_SKIP_THIS
24
25
# include <
agrum/base/database/CSVParser.h
>
26
27
namespace
gum
{
28
29
namespace
learning
{
30
31
// gets the next line of the csv stream and parses it
32
33
// search for quote taking into account the '\'...
34
35
// returns the current parsed line
36
INLINE
const
std::vector< std::string >&
CSVParser::current
()
const
{
37
if
(_emptyData_)
GUM_ERROR
(NullElement,
"No parsed data"
)
38
39
return _data_;
40
}
41
42
// returns the current nbLine of parser line
43
INLINE std::
size_t
CSVParser
::
nbLine
()
const
{
44
if
(_nbLine_ == 0)
GUM_ERROR
(NullElement,
"No parsed data"
)
45
46
return
_nbLine_;
47
}
48
49
}
/* namespace learning */
50
51
}
/* namespace gum */
52
53
#endif
/* DOXYGEN_SHOULD_SKIP_THIS */
CSVParser.h
Class for fast parsing of CSV file (never more than one line in application memory).
gum::learning::CSVParser::CSVParser
CSVParser(std::istream &in, const std::string &filename, const std::string &delimiter=",", const char commentmarker='#', const char quoteMarker='"')
default constructor
gum::learning::CSVParser::nbLine
std::size_t nbLine() const
returns the current line number within the stream
gum::learning::CSVParser::current
const std::vector< std::string > & current() const
returns the current parsed line
GUM_ERROR
#define GUM_ERROR(type, msg)
Definition
exceptions.h:76
gum::learning
include the inlined functions if necessary
Definition
CSVParser.h:55
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0