GnuCash c935c2f+
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
gnc-imp-settings-csv.hpp File Reference

CSV Import Settings. More...

#include <config.h>
#include "Account.h"
#include "gnc-commodity.h"
#include <string>
#include <vector>
#include <optional>
#include <cstdint>
#include <gnc-datetime.hpp>
#include "gnc-tokenizer.hpp"

Go to the source code of this file.

Data Structures

struct  CsvImportSettings
 

Enumerations

enum  SEP_BUTTON_TYPES {
  SEP_SPACE , SEP_TAB , SEP_COMMA , SEP_COLON ,
  SEP_SEMICOLON , SEP_HYPHEN , SEP_NUM_OF_TYPES
}
 Enumeration for separator checkbutton types. More...
 
enum  SETTINGS_COL { SET_GROUP , SET_NAME }
 Enumeration for the settings combo's. More...
 

Functions

std::string get_no_settings (void)
 
std::string get_gnc_exp (void)
 
std::string get_gnc_exp_4 (void)
 
bool preset_is_reserved_name (const std::string &name)
 Check whether name can be used as a preset name.
 
bool handle_load_error (GError **key_error, const std::string &group)
 

Detailed Description

CSV Import Settings.

Author
Copyright (c) 2014 Robert Fewell
Copyright (c) 2016 Geert Janssens

Definition in file gnc-imp-settings-csv.hpp.

Enumeration Type Documentation

◆ SEP_BUTTON_TYPES

Enumeration for separator checkbutton types.

These are the different types of checkbuttons that the user can click to configure separators in a delimited file.

Definition at line 45 of file gnc-imp-settings-csv.hpp.

45 {SEP_SPACE, SEP_TAB, SEP_COMMA, SEP_COLON, SEP_SEMICOLON, SEP_HYPHEN,
46 SEP_NUM_OF_TYPES};

◆ SETTINGS_COL

Enumeration for the settings combo's.

Definition at line 49 of file gnc-imp-settings-csv.hpp.

49{SET_GROUP, SET_NAME};

Function Documentation

◆ get_gnc_exp()

std::string get_gnc_exp ( void  )

Definition at line 107 of file gnc-imp-settings-csv.cpp.

108{
109 return gnc_exp;
110}

◆ get_gnc_exp_4()

std::string get_gnc_exp_4 ( void  )

Definition at line 112 of file gnc-imp-settings-csv.cpp.

113{
114 return gnc_exp_4;
115}

◆ get_no_settings()

std::string get_no_settings ( void  )

Definition at line 102 of file gnc-imp-settings-csv.cpp.

103{
104 return no_settings;
105}

◆ handle_load_error()

bool handle_load_error ( GError **  key_error,
const std::string &  group 
)

Definition at line 78 of file gnc-imp-settings-csv.cpp.

79{
80 if (!*key_error)
81 return false;
82
83 if ((*key_error)->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)
84 {
85 g_clear_error (key_error);
86 return false;
87 }
88
89 g_warning ("Error reading group '%s' : %s", group.c_str(), (*key_error)->message);
90 g_clear_error (key_error);
91 return true;
92}

◆ preset_is_reserved_name()

bool preset_is_reserved_name ( const std::string &  name)

Check whether name can be used as a preset name.

The names of the internal presets are considered reserved. A preset with such a name should not be saved or deleted.

Definition at line 94 of file gnc-imp-settings-csv.cpp.

95{
96 return ((name == no_settings) ||
97 (name == _(no_settings.c_str())) ||
98 (name == gnc_exp) ||
99 (name == _(gnc_exp.c_str())));
100}