51{
53 DEBUG(
"File name is : %s", info->file_name);
54
55
56 auto ss{gnc_open_filestream(info->file_name)};
57
58
59 StringVec headervec = {
60 _(
"Type"),
_(
"Full Account Name"),
_(
"Account Name"),
61 _(
"Account Code"),
_(
"Description"),
_(
"Account Color"),
62 _(
"Notes"),
_(
"Symbol"),
_(
"Namespace"),
63 _(
"Hidden"),
_(
"Tax Info"),
_(
"Placeholder")
64 };
65
66
67 info->failed = ss.fail() ||
68 !gnc_csv_add_line (ss, headervec, info->use_quotes, info->separator_str);
69
70
71 auto root{gnc_book_get_root_account (gnc_get_current_book())};
73 auto str_or_empty = [](const char* a){ return a ? a : ""; };
74 auto bool_to_char = [](bool b){ return b ? "T" : "F"; };
75
76
77 for (GList *ptr = accts; !info->failed && ptr; ptr = g_list_next (ptr))
78 {
79 auto acc{
static_cast<Account*
>(ptr->data)};
81
82 StringVec line = {
84 account_get_fullname_str (acc),
95 };
96 info->failed = !gnc_csv_add_line (ss, line, info->use_quotes, info->separator_str);
97 }
98
99 g_list_free (accts);
101}
const char * xaccAccountGetName(const Account *acc)
Get the account's name.
const char * xaccAccountGetDescription(const Account *acc)
Get the account's description.
const char * xaccAccountGetColor(const Account *acc)
Get the account's color.
GList * gnc_account_get_descendants_sorted(const Account *account)
This function returns a GList containing all the descendants of the specified account,...
GNCAccountType xaccAccountGetType(const Account *acc)
Returns the account's account type.
const char * xaccAccountGetNotes(const Account *acc)
Get the account's notes.
const char * xaccAccountGetCode(const Account *acc)
Get the account's accounting code.
gnc_commodity * xaccAccountGetCommodity(const Account *acc)
Get the account's commodity
const char * gnc_commodity_get_namespace(const gnc_commodity *cm)
Retrieve the namespace for the specified commodity.
const char * gnc_commodity_get_mnemonic(const gnc_commodity *cm)
Retrieve the mnemonic for the specified commodity.
gboolean xaccAccountGetHidden(const Account *acc)
Get the "hidden" flag for an account.
gboolean xaccAccountGetPlaceholder(const Account *acc)
Get the "placeholder" flag for an account.
const char * xaccAccountTypeEnumAsString(GNCAccountType type)
Conversion routines for the account types to/from strings that are used in persistent storage,...
gboolean xaccAccountGetTaxRelated(const Account *acc)
DOCUMENT ME!
#define DEBUG(format, args...)
Print a debugging message.
#define LEAVE(format, args...)
Print a function exit debugging message.
#define ENTER(format, args...)
Print a function entry debugging message.