PartialCsvParser  0.1.2
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Namespaces | Classes | Typedefs | Functions
PCP Namespace Reference

Namespaces

 Memory
 

Classes

class  CsvConfig
 Parses CSV file. More...
 
struct  partial_csv_t
 Set of parameters passed to PartialCsvParser::PartialCsvParser(). More...
 
class  PartialCsvParser
 Parser to split CSV into rows and columns. More...
 
class  PCPCsvError
 Thrown when invalid CSV is parsed. More...
 
class  PCPError
 Runtime error. More...
 

Typedefs

typedef struct PCP::partial_csv_t partial_csv_t
 Set of parameters passed to PartialCsvParser::PartialCsvParser(). More...
 

Functions

size_t _filesize (int opened_fd) throw (PCPError)
 
void _get_current_line (const char *const text, size_t text_length_byte, size_t current_pos, char line_terminator, const char **line, size_t *line_length_byte)
 Find a line including specified current_pos. More...
 
std::vector< std::string > _split (const char *const str, size_t len, char delimiter)
 

Typedef Documentation

Set of parameters passed to PartialCsvParser::PartialCsvParser().

Function Documentation

size_t PCP::_filesize ( int  opened_fd)
throw (PCPError
)
inline
void PCP::_get_current_line ( const char *const  text,
size_t  text_length_byte,
size_t  current_pos,
char  line_terminator,
const char **  line,
size_t *  line_length_byte 
)
inline

Find a line including specified current_pos.

Parameters
[in]textOriginal text to find a line from.
[in]text_length_byteByte length of the original text.
[in]current_posCurrent position taking 0 ~ (text_length - 1).
[in]line_terminatorCharacter to terminate a line.
[out]linePointer of start of the current line will be output.
[out]line_length_byteByte length of current line (not including line terminator) will be output.
\n aaaaaaaaaaa \n bbbbbbbbbbbbb \n cccccccccc \n
                  ^           ^  ^
                 (1)         (2)(3)

If current_pos is at between (1) and (2), line will point at (1). If current_pos is at (3), line will also point at (1).

\n ddddddddd \n eeeeeeeeeee \0
                ^            ^
               (1)          (2)

Consider null character. If current_pos is at between (1) and (2), line will point at (1).

std::vector<std::string> PCP::_split ( const char *const  str,
size_t  len,
char  delimiter 
)
inline