CSV Policy C++ Interface

The C++ interface defines the abstract interface iCSVPolicy in the oo namespace. This interface provides formatting configuration options for parsing CSV.

Class Definition

class oo::iCSVPolicy

Abstract interface for CSV Policy configuration.

Character Handling

virtual char oo::iCSVPolicy::get_delimiter() const

Gets the current field delimiter.

Returns:

The delimiter character.

virtual bool oo::iCSVPolicy::set_delimiter(char delim)

Sets the field delimiter.

Parameters:

delim – The delimiter character to set.

Returns:

true on success, false on failure.

virtual char oo::iCSVPolicy::get_quote() const

Gets the current string escaping character.

Returns:

The string escaping character.

virtual void oo::iCSVPolicy::set_quote(char quote)

Sets the string escaping character.

Parameters:

quote – The string escaping character to set.

virtual void oo::iCSVPolicy::set_no_quote()

Disables string escaping.

virtual bool oo::iCSVPolicy::is_quote_enabled() const

Checks whether string escaping is enabled.

Returns:

true if enabled, otherwise false.

virtual void oo::iCSVPolicy::add_trim_char(char trim_char)

Adds a character to the set of trim characters. If the character appears before or after a field value, it will be stripped during field value parsing.

Parameters:

trim_char – The character to add to the trim set.

virtual void oo::iCSVPolicy::clear_trim_chars()

Clears all trim characters.

Column Handling

virtual void oo::iCSVPolicy::ignore_column(int col)

Marks a column to be ignored during parsing.

Parameters:

col – The 1‑based column index to ignore.

Numeric Formatting

virtual char oo::iCSVPolicy::decimal_symbol() const

Gets the current decimal point symbol.

Returns:

The decimal point symbol.

virtual void oo::iCSVPolicy::set_decimal_symbol(char symbol)

Sets the decimal point symbol.

Parameters:

symbol – The decimal point symbol.

virtual char oo::iCSVPolicy::group_separator() const

Gets the current digit grouping separator (e.g., thousands separator).

Returns:

The digit grouping separator.

virtual void oo::iCSVPolicy::set_group_separator(char sep)

Sets the digit grouping separator (e.g., thousands separator).

Parameters:

sep – The digit grouping separator.

virtual int oo::iCSVPolicy::group_size() const

Gets the current digit grouping size (e.g., for thousands separators, the group size is 3).

Returns:

The grouping size (number of digits per group).

virtual void oo::iCSVPolicy::set_group_size(int size)

Sets the digit grouping size (e.g., for thousands separators, the group size is 3).

Parameters:

size – The grouping size.

Currency

virtual const char *oo::iCSVPolicy::currency_sign() const

Gets the current currency sign string (e.g., "$", "USD").

Returns:

The currency sign string.

virtual void oo::iCSVPolicy::set_currency_sign(const char *sign)

Sets the currency sign (e.g., "$", "USD").

Parameters:

sign – The currency sign string.

Date/Time Format

virtual const char *oo::iCSVPolicy::datetime_format() const

Gets the current date/time format string.

Returns:

The date/time format string.

virtual void oo::iCSVPolicy::set_datetime_format(const char *fmt)

Sets the date/time format string.

Parameters:

fmt – The date/time format string (e.g., "%Y-%m-%d %H:%M:%S").

Date/Time Format Specifier Reference

Specifier

Description

Example

%Y

Full year

2026

%y

Last two digits of year

26

%m

Two‑digit month (01 to 12)

01

%b

Abbreviated month name (Jan, Feb, …)

Jan

%h

Same as %b

%B

Full month name (January, February, …)

January

%d

Two‑digit day (01 to 31)

03

%a

Abbreviated weekday (Sun, Mon, …)

Mon

%A

Full weekday (Sunday, Monday, …)

Monday

%H

Hour in 24‑hour format (00 to 23)

14

%I

Hour in 12‑hour format (01 to 12)

02

%M

Minute (00 to 59)

45

%S

Second (00 to 59)

30

%p

AM or PM (with 12‑hour hour)

AM

%z

Time zone offset (e.g., +0200 or -0800)

+0000

%Z

Time zone name (Only “UTC” is supported)

UTC

%n

Matches whitespace

%t

Matches whitespace

%.

Matches any character (skips it)