GnuCash  5.6-150-g038405b370+
Data Structures | Typedefs | Enumerations | Variables
gnc-import-tx.hpp File Reference

Class to import transactions from CSV or fixed width files. More...

#include <config.h>
#include "Account.h"
#include "Transaction.h"
#include <vector>
#include <set>
#include <map>
#include <memory>
#include <optional>
#include <cstdint>
#include "gnc-tokenizer.hpp"
#include "gnc-imp-props-tx.hpp"
#include "gnc-imp-settings-csv-tx.hpp"

Go to the source code of this file.

Data Structures

struct  GncCsvImpParseError
 Exception that will be thrown whenever a parsing error is encountered. More...
 
class  GncTxImport
 The actual TxImport class It's intended to use in the following sequence of actions: More...
 

Typedefs

using StrVec = std::vector< std::string >
 
using parse_line_t = std::tuple< StrVec, ErrMap, std::shared_ptr< GncPreTrans >, std::shared_ptr< GncPreSplit >, bool >
 Tuple to hold all internal state for one parsed line. More...
 

Enumerations

enum  parse_line_cols {
  PL_INPUT, PL_ERROR, PL_PREPRICE, PL_SKIP,
  PL_INPUT, PL_ERROR, PL_PRETRANS, PL_PRESPLIT,
  PL_SKIP
}
 An enum describing the columns found in a parse_line_t. More...
 

Variables

const int num_currency_formats
 
const gchar * currency_format_user []
 

Detailed Description

Class to import transactions from CSV or fixed width files.

gnc-import-tx.hpp

Author
Copyright (c) 2015 Geert Janssens geert.nosp@m.@kob.nosp@m.altwi.nosp@m.t.be

Definition in file gnc-import-tx.hpp.

Typedef Documentation

◆ parse_line_t

using parse_line_t = std::tuple<StrVec, ErrMap, std::shared_ptr<GncPreTrans>, std::shared_ptr<GncPreSplit>, bool>

Tuple to hold all internal state for one parsed line.

The contents of each column is described by the parse_line_cols enum. This enum should be used with std::get to access the columns.

Definition at line 78 of file gnc-import-tx.hpp.

Enumeration Type Documentation

◆ parse_line_cols

An enum describing the columns found in a parse_line_t.

Currently these are:

  • a tokenized line of input
  • an optional error string
  • a struct to hold user selected properties for a transaction as found on the current line
  • a struct to hold user selected properties for one or two splits in the above transaction this split struct also contains a trans props struct like above, but the included one may be shared by several split lines that comprise a single transaction
  • a boolean to mark the line as skipped by error and/or user or not

Definition at line 61 of file gnc-import-tx.hpp.

61  {
62  PL_INPUT,
63  PL_ERROR,
64  PL_PRETRANS,
65  PL_PRESPLIT,
66  PL_SKIP
67 };