[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/007 03989383 04/18: Add a new ledger emissio
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/007 03989383 04/18: Add a new ledger emission option |
Date: |
Sun, 24 Apr 2022 18:46:13 -0400 (EDT) |
branch: valyuta/007
commit 039893835d2b3a3c17ddacf271a31eb0d501f672
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Add a new ledger emission option
As a general default, class ledger_emitter writes output files to the
configurable print directory. Added an option to write them to the
present working directory instead: soon that will become useful for
testing.
Added the new option early in the list, whose first few enumerators
answer general "how?" questions, whereas later enumerators answer
particular "what?" questions. Changing the power-of-two enumerators
is safe because the underlying values are used only by name, never by
explicit numeric value.
---
emit_ledger.cpp | 3 ++-
mc_enum_type_enums.hpp | 23 ++++++++++++-----------
mc_enum_types.cpp | 4 +++-
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/emit_ledger.cpp b/emit_ledger.cpp
index 33e12838..d3e5d986 100644
--- a/emit_ledger.cpp
+++ b/emit_ledger.cpp
@@ -54,9 +54,10 @@ ledger_emitter::ledger_emitter
{
LMI_ASSERT(!case_filepath_.empty());
+ bool const emit_to_pwd = emission_ & mce_emit_to_pwd;
configurable_settings const& c = configurable_settings::instance();
std::string const& tsv_ext = c.spreadsheet_file_extension();
- std::string const& print_dir = c.print_directory();
+ std::string const& print_dir = emit_to_pwd ? "" : c.print_directory();
fs::path const f(modify_directory(case_filepath_, print_dir));
if(emission_ & mce_emit_spreadsheet)
diff --git a/mc_enum_type_enums.hpp b/mc_enum_type_enums.hpp
index e5e8ddcd..ca71e49d 100644
--- a/mc_enum_type_enums.hpp
+++ b/mc_enum_type_enums.hpp
@@ -42,17 +42,18 @@ enum mcenum_emission
{mce_emit_nothing = 0
,mce_emit_composite_only = 1
,mce_emit_quietly = 2
- ,mce_emit_timings = 4
- ,mce_emit_pdf_file = 8
- ,mce_emit_pdf_to_printer = 16 // GUI only.
- ,mce_emit_pdf_to_viewer = 32 // GUI only.
- ,mce_emit_test_data = 64
- ,mce_emit_spreadsheet = 128
- ,mce_emit_group_roster = 256
- ,mce_emit_text_stream = 512
- ,mce_emit_custom_0 = 1024
- ,mce_emit_custom_1 = 2048
- ,mce_emit_group_quote = 4096
+ ,mce_emit_to_pwd = 4
+ ,mce_emit_timings = 8
+ ,mce_emit_pdf_file = 16
+ ,mce_emit_pdf_to_printer = 32 // GUI only.
+ ,mce_emit_pdf_to_viewer = 64 // GUI only.
+ ,mce_emit_test_data = 128
+ ,mce_emit_spreadsheet = 256
+ ,mce_emit_group_roster = 512
+ ,mce_emit_text_stream = 1024
+ ,mce_emit_custom_0 = 2048
+ ,mce_emit_custom_1 = 4096
+ ,mce_emit_group_quote = 8192
};
/// Rounding styles.
diff --git a/mc_enum_types.cpp b/mc_enum_types.cpp
index c53b100e..ded2be53 100644
--- a/mc_enum_types.cpp
+++ b/mc_enum_types.cpp
@@ -56,6 +56,7 @@ extern mcenum_emission const emission_enums[] =
{mce_emit_nothing
,mce_emit_composite_only
,mce_emit_quietly
+ ,mce_emit_to_pwd
,mce_emit_timings
,mce_emit_pdf_file
,mce_emit_pdf_to_printer
@@ -72,6 +73,7 @@ extern char const*const emission_strings[] =
{"emit_nothing"
,"emit_composite_only"
,"emit_quietly"
+ ,"emit_to_pwd"
,"emit_timings"
,"emit_pdf_file"
,"emit_pdf_to_printer"
@@ -85,7 +87,7 @@ extern char const*const emission_strings[] =
,"emit_group_quote"
};
template<> struct mc_enum_key<mcenum_emission>
- :public mc_enum_data<mcenum_emission, 14, emission_enums, emission_strings>
{};
+ :public mc_enum_data<mcenum_emission, 15, emission_enums, emission_strings>
{};
template class mc_enum<mcenum_emission>;
extern rounding_style const rounding_style_enums[] =
- [lmi-commits] [lmi] valyuta/007 updated (1cc76075 -> 9bc66a02), Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 03989383 04/18: Add a new ledger emission option,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/007 a30da52f 06/18: Test eleven farraginous files nychthemerally, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 d8b0c732 10/18: Record speed measurements, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 8c56b11b 11/18: Improve documentation, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 66592ac8 12/18: Rearrange ledger formats, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 9201d7ef 01/18: Allow "touchstone" files to contain '\t', Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 ba639668 08/18: Reorder format-style map, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 b480490b 13/18: Distinguish two ledger formats, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 9bc66a02 18/18: Revert "Temporarily filter out factor-of-100 errors", Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 e8a5d1a4 17/18: Temporarily filter out factor-of-100 errors, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 f77d9219 05/18: Add two new ledger emission options, Greg Chicares, 2022/04/24