30 #ifndef GNC_PRICE_IMPORT_HPP 31 #define GNC_PRICE_IMPORT_HPP 44 #include "gnc-imp-props-price.hpp" 48 extern const int num_currency_formats_price;
49 extern const gchar* currency_format_user_price[];
69 std::shared_ptr<GncImportPrice>,
92 void over_write (
bool over);
96 gnc_commodity *from_commodity ();
99 gnc_commodity *to_currency ();
101 void currency_format (
int currency_format);
102 int currency_format ();
104 void date_format (
int date_format);
108 std::string encoding ();
110 void update_skipped_lines (std::optional<uint32_t> start, std::optional<uint32_t> end,
111 std::optional<bool> alt, std::optional<bool> errors);
112 uint32_t skip_start_lines ();
113 uint32_t skip_end_lines ();
114 bool skip_alt_lines ();
115 bool skip_err_lines ();
117 void separators (std::string separators);
118 std::string separators ();
121 bool save_settings ();
123 void settings_name (std::string name);
124 std::string settings_name ();
127 void load_file (
const std::string& filename);
131 std::string verify();
137 bool check_for_column_type (GncPricePropType type);
138 void set_column_type_price (uint32_t position, GncPricePropType type,
bool force =
false);
139 std::vector<GncPricePropType> column_types_price ();
146 int m_prices_duplicated;
147 int m_prices_replaced;
154 void create_price (std::vector<parse_line_t>::iterator& parsed_line);
159 void reset_formatted_column (std::vector<GncPricePropType>& col_types);
164 void update_price_props (uint32_t row, uint32_t col, GncPricePropType prop_type);
void create_prices()
This function will attempt to convert all tokenized lines into prices using the column types the user...
GncPriceImport(GncImpFileFormat format=GncImpFileFormat::UNKNOWN)
Constructor for GncPriceImport.
The actual PriceImport class It's intended to use in the following sequence of actions: ...
~GncPriceImport()
Destructor for GncPriceImport.
parse_line_cols
An enum describing the columns found in a parse_line_t.
std::tuple< StrVec, std::string, std::shared_ptr< GncImportPrice >, bool > parse_line_t
Tuple to hold.
void tokenize(bool guessColTypes)
Splits a file into cells.
std::unique_ptr< GncTokenizer > m_tokenizer
Will handle file loading/encoding conversion/splitting into fields.
std::vector< parse_line_t > m_parsed_lines
source file parsed into a two-dimensional array of strings.
void to_currency(gnc_commodity *to_currency)
Sets a to currency.
Class convert a file into vector of string vectors.
GncImpFileFormat
Enumeration for file formats supported by this importer.
void from_commodity(gnc_commodity *from_commodity)
Sets a from commodity.
void file_format(GncImpFileFormat format)
Sets the file format for the file to import, which may cause the file to be reloaded as well if the p...
void load_file(const std::string &filename)
Loads a file into a GncPriceImport.
void encoding(const std::string &encoding)
Converts raw file data using a new encoding.
Commodity handling public routines.