summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt15
-rw-r--r--src/account.cc2
-rw-r--r--src/account.h28
-rw-r--r--src/amount.cc81
-rw-r--r--src/amount.h12
-rw-r--r--src/annotate.cc2
-rw-r--r--src/annotate.h50
-rw-r--r--src/archive.cc295
-rw-r--r--src/archive.h92
-rw-r--r--src/balance.cc2
-rw-r--r--src/balance.h14
-rw-r--r--src/chain.cc2
-rw-r--r--src/chain.h2
-rw-r--r--src/commodity.cc2
-rw-r--r--src/commodity.h63
-rw-r--r--src/compare.cc2
-rw-r--r--src/compare.h2
-rw-r--r--src/context.h2
-rw-r--r--src/convert.cc2
-rw-r--r--src/convert.h2
-rw-r--r--src/csv.cc2
-rw-r--r--src/csv.h2
-rw-r--r--src/draft.cc2
-rw-r--r--src/draft.h2
-rw-r--r--src/emacs.cc2
-rw-r--r--src/emacs.h4
-rw-r--r--src/error.cc2
-rw-r--r--src/error.h2
-rw-r--r--src/expr.cc2
-rw-r--r--src/expr.h15
-rw-r--r--src/exprbase.h17
-rw-r--r--src/filters.cc4
-rw-r--r--src/filters.h2
-rw-r--r--src/flags.h24
-rw-r--r--src/format.cc2
-rw-r--r--src/format.h2
-rw-r--r--src/generate.cc2
-rw-r--r--src/generate.h2
-rw-r--r--src/global.cc16
-rw-r--r--src/global.h5
-rw-r--r--src/history.cc4
-rw-r--r--src/history.h2
-rw-r--r--src/item.cc2
-rw-r--r--src/item.h44
-rw-r--r--src/iterators.cc4
-rw-r--r--src/iterators.h2
-rw-r--r--src/journal.cc2
-rw-r--r--src/journal.h37
-rw-r--r--src/lookup.cc4
-rw-r--r--src/lookup.h2
-rw-r--r--src/main.cc2
-rw-r--r--src/mask.cc2
-rw-r--r--src/mask.h21
-rw-r--r--src/op.cc2
-rw-r--r--src/op.h29
-rw-r--r--src/option.cc2
-rw-r--r--src/option.h2
-rw-r--r--src/org.cc2
-rw-r--r--src/org.h2
-rw-r--r--src/output.cc8
-rw-r--r--src/output.h12
-rw-r--r--src/parser.cc2
-rw-r--r--src/parser.h4
-rw-r--r--src/pool.cc2
-rw-r--r--src/pool.h26
-rw-r--r--src/post.cc2
-rw-r--r--src/post.h26
-rw-r--r--src/precmd.cc2
-rw-r--r--src/precmd.h2
-rw-r--r--src/predicate.h15
-rw-r--r--src/print.cc2
-rw-r--r--src/print.h2
-rw-r--r--src/pstream.h2
-rw-r--r--src/ptree.cc2
-rw-r--r--src/ptree.h2
-rw-r--r--src/py_account.cc2
-rw-r--r--src/py_amount.cc2
-rw-r--r--src/py_balance.cc2
-rw-r--r--src/py_commodity.cc5
-rw-r--r--src/py_expr.cc2
-rw-r--r--src/py_format.cc2
-rw-r--r--src/py_item.cc16
-rw-r--r--src/py_journal.cc5
-rw-r--r--src/py_post.cc2
-rw-r--r--src/py_session.cc2
-rw-r--r--src/py_times.cc2
-rw-r--r--src/py_utils.cc2
-rw-r--r--src/py_value.cc2
-rw-r--r--src/py_xact.cc2
-rw-r--r--src/pyfstream.h2
-rw-r--r--src/pyinterp.cc2
-rw-r--r--src/pyinterp.h4
-rw-r--r--src/pyledger.cc2
-rw-r--r--src/pyutils.h2
-rw-r--r--src/query.cc2
-rw-r--r--src/query.h2
-rw-r--r--src/quotes.cc2
-rw-r--r--src/quotes.h2
-rw-r--r--src/report.cc3
-rw-r--r--src/report.h9
-rw-r--r--src/scope.cc2
-rw-r--r--src/scope.h101
-rw-r--r--src/select.cc4
-rw-r--r--src/select.h2
-rw-r--r--src/session.cc101
-rw-r--r--src/session.h4
-rw-r--r--src/stats.cc2
-rw-r--r--src/stats.h2
-rw-r--r--src/stream.cc2
-rw-r--r--src/stream.h2
-rw-r--r--src/strptime.cc2
-rw-r--r--src/system.hh.in93
-rw-r--r--src/temps.cc2
-rw-r--r--src/temps.h2
-rw-r--r--src/textual.cc2
-rw-r--r--src/timelog.cc2
-rw-r--r--src/timelog.h2
-rw-r--r--src/times.cc2
-rw-r--r--src/times.h94
-rw-r--r--src/token.cc2
-rw-r--r--src/token.h2
-rw-r--r--src/unistring.h2
-rw-r--r--src/utils.cc2
-rw-r--r--src/utils.h2
-rw-r--r--src/value.cc6
-rw-r--r--src/value.h32
-rw-r--r--src/views.cc2
-rw-r--r--src/views.h4
-rw-r--r--src/wcwidth.cc2
-rw-r--r--src/xact.cc2
-rw-r--r--src/xact.h74
131 files changed, 251 insertions, 1445 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dc8b60fc..65e58edb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,7 +28,6 @@ set(LEDGER_SOURCES
textual.cc
temps.cc
journal.cc
- archive.cc
account.cc
xact.cc
post.cc
@@ -80,7 +79,6 @@ set(LEDGER_INCLUDES
account.h
amount.h
annotate.h
- archive.h
balance.h
chain.h
commodity.h
@@ -154,7 +152,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-Wno-unused-parameter
-Wno-c++98-compat
-fno-limit-debug-info)
-
+
macro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
set(_pch_filename "${_header_filename}.pch")
@@ -190,7 +188,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${_args}
DEPENDS ${_header_filename})
endmacro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
-
+
elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
set(GXX_WARNING_FLAGS
-pedantic
@@ -212,7 +210,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-Wno-strict-aliasing)
add_definitions(${GXX_WARNING_FLAGS})
-
+
macro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
set(_gch_filename "${_header_filename}.gch")
@@ -249,7 +247,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${_args}
DEPENDS ${_header_filename})
endmacro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
-
+
else()
macro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
endmacro(ADD_PCH_RULE _header_filename _src_list _other_srcs)
@@ -275,6 +273,9 @@ if (BUILD_LIBRARY)
add_executable(ledger main.cc global.cc)
target_link_libraries(ledger libledger)
+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin AND HAVE_BOOST_PYTHON)
+ target_link_libraries(ledger ${PYTHON_LIBRARIES})
+ endif()
install(TARGETS libledger DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${LEDGER_INCLUDES}
@@ -296,7 +297,7 @@ print(s.get_python_lib(True, prefix=''))"
if (PYTHON_SITE_PACKAGES)
if (WIN32 AND NOT CYGWIN)
set(_ledger_python_module_name "ledger.pyd")
- elseif(CMAKE_HOST_APPLE)
+ elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(_ledger_python_module_name "ledger.so")
else()
set(_ledger_python_module_name "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}")
diff --git a/src/account.cc b/src/account.cc
index 358aa09a..2a48eaf5 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/account.h b/src/account.h
index 76e839eb..4a4e859d 100644
--- a/src/account.h
+++ b/src/account.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -261,11 +261,7 @@ public:
mutable optional<xdata_t> xdata_;
bool has_xdata() const {
-#if BOOST_VERSION >= 105600
- return xdata_ != NULL;
-#else
- return xdata_;
-#endif
+ return static_cast<bool>(xdata_);
}
void clear_xdata();
xdata_t& xdata() {
@@ -289,26 +285,6 @@ public:
}
bool children_with_xdata() const;
std::size_t children_with_flags(xdata_t::flags_t flags) const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<supports_flags<> >(*this);
- ar & boost::serialization::base_object<scope_t>(*this);
- ar & parent;
- ar & name;
- ar & note;
- ar & depth;
- ar & accounts;
- ar & posts;
- ar & _fullname;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
std::ostream& operator<<(std::ostream& out, const account_t& account);
diff --git a/src/amount.cc b/src/amount.cc
index 6ddcdb4f..52ccbc88 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -93,20 +93,6 @@ struct amount_t::bigint_t : public supports_flags<>
}
return true;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */)
- {
- ar & boost::serialization::base_object<supports_flags<> >(*this);
- ar & val;
- ar & prec;
- ar & refc;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
bool amount_t::is_initialized = false;
@@ -1331,69 +1317,4 @@ void put_amount(property_tree::ptree& st, const amount_t& amt,
st.put("quantity", amt.quantity_string());
}
-#if HAVE_BOOST_SERIALIZATION
-
-template<class Archive>
-void amount_t::serialize(Archive& ar, const unsigned int /* version */)
-{
- ar & is_initialized;
- ar & quantity;
- ar & commodity_;
-}
-
-#endif // HAVE_BOOST_SERIALIZATION
-
} // namespace ledger
-
-#if HAVE_BOOST_SERIALIZATION
-namespace boost {
-namespace serialization {
-
-template <class Archive>
-void serialize(Archive& ar, MP_INT& mpz, const unsigned int /* version */)
-{
- ar & mpz._mp_alloc;
- ar & mpz._mp_size;
- ar & mpz._mp_d;
-}
-
-template <class Archive>
-void serialize(Archive& ar, MP_RAT& mpq, const unsigned int /* version */)
-{
- ar & mpq._mp_num;
- ar & mpq._mp_den;
-}
-
-template <class Archive>
-void serialize(Archive& ar, long unsigned int& integer,
- const unsigned int /* version */)
-{
- ar & make_binary_object(&integer, sizeof(long unsigned int));
-}
-
-} // namespace serialization
-} // namespace boost
-
-BOOST_CLASS_EXPORT(ledger::annotated_commodity_t)
-
-template void boost::serialization::serialize(boost::archive::binary_iarchive&,
- MP_INT&, const unsigned int);
-template void boost::serialization::serialize(boost::archive::binary_oarchive&,
- MP_INT&, const unsigned int);
-template void boost::serialization::serialize(boost::archive::binary_iarchive&,
- MP_RAT&, const unsigned int);
-template void boost::serialization::serialize(boost::archive::binary_oarchive&,
- MP_RAT&, const unsigned int);
-template void boost::serialization::serialize(boost::archive::binary_iarchive&,
- long unsigned int&,
- const unsigned int);
-template void boost::serialization::serialize(boost::archive::binary_oarchive&,
- long unsigned int&,
- const unsigned int);
-
-template void ledger::amount_t::serialize(boost::archive::binary_iarchive&,
- const unsigned int);
-template void ledger::amount_t::serialize(boost::archive::binary_oarchive&,
- const unsigned int);
-
-#endif // HAVE_BOOST_SERIALIZATION
diff --git a/src/amount.h b/src/amount.h
index ea5cadd6..8885a69d 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -743,16 +743,6 @@ public:
bool valid() const;
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */);
-#endif // HAVE_BOOST_SERIALIZATION
-
/*@}*/
};
diff --git a/src/annotate.cc b/src/annotate.cc
index 7c54edef..e953f441 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/annotate.h b/src/annotate.h
index c0fbcd3d..0ea2561b 100644
--- a/src/annotate.h
+++ b/src/annotate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -107,21 +107,6 @@ struct annotation_t : public supports_flags<>,
assert(*this);
return true;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<supports_flags<> >(*this);
- ar & price;
- ar & date;
- ar & tag;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
void put_annotation(property_tree::ptree& pt, const annotation_t& details);
@@ -162,21 +147,6 @@ struct keep_details_t
return keep_price || keep_date || keep_tag;
}
bool keep_any(const commodity_t& comm) const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & keep_price;
- ar & keep_date;
- ar & keep_tag;
- ar & only_actuals;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline std::ostream& operator<<(std::ostream& out,
@@ -250,24 +220,6 @@ public:
virtual void write_annotations(std::ostream& out,
bool no_computed_annotations = false) const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- explicit annotated_commodity_t() : ptr(NULL) {
- TRACE_CTOR(annotated_commodity_t, "");
- }
-
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<commodity_t>(*this);
- ar & ptr;
- ar & details;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline annotated_commodity_t&
diff --git a/src/archive.cc b/src/archive.cc
deleted file mode 100644
index 9ae04e85..00000000
--- a/src/archive.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * - Neither the name of New Artisans LLC nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <system.hh>
-
-#if HAVE_BOOST_SERIALIZATION
-
-#include "archive.h"
-#include "amount.h"
-#include "commodity.h"
-#include "pool.h"
-#include "scope.h"
-#include "account.h"
-#include "post.h"
-#include "xact.h"
-
-#define LEDGER_MAGIC 0x4c454447
-#define ARCHIVE_VERSION 0x03000006
-
-//BOOST_IS_ABSTRACT(ledger::scope_t)
-BOOST_CLASS_EXPORT(ledger::scope_t)
-BOOST_CLASS_EXPORT(ledger::child_scope_t)
-BOOST_CLASS_EXPORT(ledger::symbol_scope_t)
-BOOST_CLASS_EXPORT(ledger::call_scope_t)
-BOOST_CLASS_EXPORT(ledger::account_t)
-BOOST_CLASS_EXPORT(ledger::item_t)
-BOOST_CLASS_EXPORT(ledger::post_t)
-BOOST_CLASS_EXPORT(ledger::xact_base_t)
-BOOST_CLASS_EXPORT(ledger::xact_t)
-BOOST_CLASS_EXPORT(ledger::auto_xact_t)
-BOOST_CLASS_EXPORT(ledger::period_xact_t)
-
-template void ledger::journal_t::serialize(boost::archive::binary_oarchive&,
- const unsigned int);
-template void ledger::journal_t::serialize(boost::archive::binary_iarchive&,
- const unsigned int);
-namespace ledger {
-
-namespace {
- bool read_header_bits(std::istream& in) {
- uint32_t bytes;
-
- assert(sizeof(uint32_t) == 4);
- in.read(reinterpret_cast<char *>(&bytes), sizeof(uint32_t));
- if (bytes != LEDGER_MAGIC) {
- DEBUG("archive.journal", "Magic bytes not present");
- return false;
- }
-
- in.read(reinterpret_cast<char *>(&bytes), sizeof(uint32_t));
- if (bytes != ARCHIVE_VERSION) {
- DEBUG("archive.journal", "Archive version mismatch");
- return false;
- }
-
- return true;
- }
-
- void write_header_bits(std::ostream& out) {
- uint32_t bytes;
-
- assert(sizeof(uint32_t) == 4);
- bytes = LEDGER_MAGIC;
- out.write(reinterpret_cast<char *>(&bytes), sizeof(uint32_t));
-
- bytes = ARCHIVE_VERSION;
- out.write(reinterpret_cast<char *>(&bytes), sizeof(uint32_t));
- }
-}
-
-bool archive_t::read_header()
-{
- uintmax_t size = file_size(file);
- if (size < 8)
- return false;
-
- // Open the stream, read the version number and the list of sources
- ifstream stream(file, std::ios::binary);
- if (! read_header_bits(stream))
- return false;
-
- boost::archive::binary_iarchive iarchive(stream);
-
- DEBUG("archive.journal", "Reading header from archive");
- iarchive >> *this;
-
- DEBUG("archive.journal",
- "Version number: " << std::hex << ARCHIVE_VERSION << std::dec);
- DEBUG("archive.journal", "Number of sources: " << sources.size());
-
-#if DEBUG_ON
- foreach (const journal_t::fileinfo_t& i, sources)
- DEBUG("archive.journal", "Loaded source: " << *i.filename);
-#endif
-
- return true;
-}
-
-bool archive_t::should_load(const std::list<path>& data_files)
-{
- std::size_t found = 0;
-
- DEBUG("archive.journal", "Should the archive be loaded?");
-
- if (! exists(file)) {
- DEBUG("archive.journal", "No, it does not exist");
- return false;
- }
-
- if (! read_header()) {
- DEBUG("archive.journal", "No, header failed to read");
- return false;
- }
-
- if (data_files.empty()) {
- DEBUG("archive.journal", "No, there were no data files!");
- return false;
- }
-
- if (sources.empty()) {
- DEBUG("archive.journal", "No, there were no sources!");
- return false;
- }
-
- if (data_files.size() != sources.size()) {
- DEBUG("archive.journal", "No, number of sources doesn't match: "
- << data_files.size() << " != " << sources.size());
- return false;
- }
-
- foreach (const path& p, data_files) {
- DEBUG("archive.journal", "Scanning for data file: " << p);
-
- if (! exists(p)) {
- DEBUG("archive.journal", "No, an input source no longer exists: " << p);
- return false;
- }
-
- foreach (const journal_t::fileinfo_t& i, sources) {
- assert(! i.from_stream);
- assert(i.filename);
-
- DEBUG("archive.journal", "Comparing against source file: " << *i.filename);
-
- if (*i.filename == p) {
- if (! exists(*i.filename)) {
- DEBUG("archive.journal",
- "No, a referent source no longer exists: " << *i.filename);
- return false;
- }
-
- if (i.modtime != posix_time::from_time_t(last_write_time(p))) {
- DEBUG("archive.journal", "No, a source's modtime has changed: " << p);
- return false;
- }
-
- if (i.size != file_size(p)) {
- DEBUG("archive.journal", "No, a source's size has changed: " << p);
- return false;
- }
-
- found++;
- }
- }
- }
-
- if (found != data_files.size()) {
- DEBUG("archive.journal", "No, not every source's name matched");
- return false;
- }
-
- DEBUG("archive.journal", "Yes, it should be loaded!");
- return true;
-}
-
-bool archive_t::should_save(journal_t& journal)
-{
- std::list<path> data_files;
-
- DEBUG("archive.journal", "Should the archive be saved?");
-
- if (journal.was_loaded) {
- DEBUG("archive.journal", "No, it's one we loaded before");
- return false;
- }
-
- if (journal.sources.empty()) {
- DEBUG("archive.journal", "No, there were no sources!");
- return false;
- }
-
- foreach (const journal_t::fileinfo_t& i, journal.sources) {
- if (i.from_stream) {
- DEBUG("archive.journal", "No, one source was from a stream");
- return false;
- }
-
- if (! exists(*i.filename)) {
- DEBUG("archive.journal",
- "No, a source no longer exists: " << *i.filename);
- return false;
- }
-
- data_files.push_back(*i.filename);
- }
-
- if (should_load(data_files)) {
- DEBUG("archive.journal", "No, because it's still loadable");
- return false;
- }
-
- DEBUG("archive.journal", "Yes, it should be saved!");
- return true;
-}
-
-void archive_t::save(journal_t& journal)
-{
- INFO_START(archive, "Saved journal file cache");
-
- ofstream stream(file, std::ios::binary);
-
- write_header_bits(stream);
- sources = journal.sources;
-
-#if DEBUG_ON
- foreach (const journal_t::fileinfo_t& i, sources)
- DEBUG("archive.journal", "Saving source: " << *i.filename);
-#endif
-
- boost::archive::binary_oarchive oa(stream);
-
- DEBUG("archive.journal", "Creating archive with version "
- << std::hex << ARCHIVE_VERSION << std::dec);
- oa << *this;
-
- DEBUG("archive.journal",
- "Archiving journal with " << sources.size() << " sources");
- oa << journal;
-
- INFO_FINISH(archive);
-}
-
-bool archive_t::load(journal_t& journal)
-{
- INFO_START(archive, "Read cached journal file");
-
- ifstream stream(file, std::ios::binary);
- if (! read_header_bits(stream))
- return false;
-
- boost::archive::binary_iarchive iarchive(stream);
-
- // Skip past the archive header, it was already read in before
- archive_t temp;
- iarchive >> temp;
-
- iarchive >> journal;
- journal.was_loaded = true;
-
- INFO_FINISH(archive);
-
- return true;
-}
-
-} // namespace ledger
-
-#endif // HAVE_BOOST_SERIALIZATION
diff --git a/src/archive.h b/src/archive.h
deleted file mode 100644
index 485f9606..00000000
--- a/src/archive.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * - Neither the name of New Artisans LLC nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @defgroup report Reporting
- */
-
-/**
- * @file archive.h
- * @author John Wiegley
- *
- * @ingroup report
- */
-#ifndef _ARCHIVE_H
-#define _ARCHIVE_H
-
-#include "journal.h"
-
-namespace ledger {
-
-class archive_t
-{
- path file;
-
- std::list<journal_t::fileinfo_t> sources;
-
-public:
- archive_t() {
- TRACE_CTOR(archive_t, "");
- }
- archive_t(const path& _file) : file(_file) {
- TRACE_CTOR(archive_t, "const path&");
- }
- archive_t(const archive_t& ar) : file(ar.file) {
- TRACE_CTOR(archive_t, "copy");
- }
- ~archive_t() {
- TRACE_DTOR(archive_t);
- }
-
- bool read_header();
-
- bool should_load(const std::list<path>& data_files);
- bool should_save(journal_t& journal);
-
- void save(journal_t& journal);
- bool load(journal_t& journal);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & sources;
- }
-#endif // HAVE_BOOST_SERIALIZATION
-};
-
-} // namespace ledger
-
-#endif // _ARCHIVE_H
diff --git a/src/balance.cc b/src/balance.cc
index 36eab7d4..ca14c7ff 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/balance.h b/src/balance.h
index 752bb4d6..d68fccc8 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -594,18 +594,6 @@ public:
}
return true;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & amounts;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline std::ostream& operator<<(std::ostream& out, const balance_t& bal) {
diff --git a/src/chain.cc b/src/chain.cc
index 42f474c4..94afc0fa 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/chain.h b/src/chain.h
index 224bed21..16fb4400 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/commodity.cc b/src/commodity.cc
index 398245fb..1475f52e 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/commodity.h b/src/commodity.h
index 3d1ddf04..1741bfaf 100644
--- a/src/commodity.h
+++ b/src/commodity.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -68,19 +68,6 @@ struct price_point_t
bool operator==(const price_point_t& other) const {
return when == other.when && price == other.price;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & when;
- ar & price;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class commodity_t
@@ -138,28 +125,6 @@ protected:
virtual ~base_t() {
TRACE_DTOR(commodity_t::base_t);
}
-
-#if HAVE_BOOST_SERIALIZATION
- private:
- base_t() {
- TRACE_CTOR(base_t, "");
- }
-
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<supports_flags<uint_least16_t> >(*this);
- ar & symbol;
- ar & precision;
- ar & name;
- ar & note;
- ar & smaller;
- ar & larger;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
shared_ptr<base_t> base;
@@ -315,32 +280,6 @@ public:
struct compare_by_commodity {
bool operator()(const amount_t * left, const amount_t * right) const;
};
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- supports_flags<uint_least16_t> temp_flags;
-
-protected:
- explicit commodity_t()
- : delegates_flags<uint_least16_t>(temp_flags), parent_(NULL),
- annotated(false) {
- TRACE_CTOR(commodity_t, "");
- }
-
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<delegates_flags<uint_least16_t> >(*this);
- ar & base;
- ar & parent_;
- ar & qualified_symbol;
- ar & annotated;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline std::ostream& operator<<(std::ostream& out, const commodity_t& comm) {
diff --git a/src/compare.cc b/src/compare.cc
index db169cfc..547acc18 100644
--- a/src/compare.cc
+++ b/src/compare.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/compare.h b/src/compare.h
index 554e84aa..baee6075 100644
--- a/src/compare.h
+++ b/src/compare.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/context.h b/src/context.h
index e787f335..61797dc4 100644
--- a/src/context.h
+++ b/src/context.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/convert.cc b/src/convert.cc
index a4454c14..d0a0dc39 100644
--- a/src/convert.cc
+++ b/src/convert.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/convert.h b/src/convert.h
index 020dfea2..cb6bcd71 100644
--- a/src/convert.h
+++ b/src/convert.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/csv.cc b/src/csv.cc
index b0a54f4e..85e41057 100644
--- a/src/csv.cc
+++ b/src/csv.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/csv.h b/src/csv.h
index cda15ea3..a294a865 100644
--- a/src/csv.h
+++ b/src/csv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/draft.cc b/src/draft.cc
index 78e53ccd..f7557373 100644
--- a/src/draft.cc
+++ b/src/draft.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/draft.h b/src/draft.h
index 7ba40640..f4c24c26 100644
--- a/src/draft.h
+++ b/src/draft.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/emacs.cc b/src/emacs.cc
index dc16c002..9f2626a3 100644
--- a/src/emacs.cc
+++ b/src/emacs.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/emacs.h b/src/emacs.h
index fef7a882..52b7bd37 100644
--- a/src/emacs.h
+++ b/src/emacs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -72,7 +72,7 @@ public:
out.flush();
}
virtual void operator()(post_t& post);
- virtual string escape_string(string raw);
+ virtual string escape_string(string raw);
};
} // namespace ledger
diff --git a/src/error.cc b/src/error.cc
index 90697c5f..4b3565a3 100644
--- a/src/error.cc
+++ b/src/error.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/error.h b/src/error.h
index 31fa76a3..73a0e395 100644
--- a/src/error.h
+++ b/src/error.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/expr.cc b/src/expr.cc
index e38d794f..bc877c1a 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/expr.h b/src/expr.h
index 384cc661..bbe4bf74 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -106,19 +106,6 @@ public:
virtual string context_to_str() const;
virtual void print(std::ostream& out) const;
virtual void dump(std::ostream& out) const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<base_type>(*this);
- ar & ptr;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
/**
diff --git a/src/exprbase.h b/src/exprbase.h
index b88fcd7d..6d13c429 100644
--- a/src/exprbase.h
+++ b/src/exprbase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -231,21 +231,6 @@ public:
out << std::endl << _("--- Result value ---") << std::endl;
return calc();
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & context;
- ar & str;
- if (Archive::is_loading::value)
- compiled = false;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
template <typename ResultType>
diff --git a/src/filters.cc b/src/filters.cc
index 2f97a0e5..1d7832ca 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -707,7 +707,7 @@ namespace {
insert_prices_in_map(price_map_t& _all_prices)
: all_prices(_all_prices) {}
- void operator()(datetime_t& date, const amount_t& price) {
+ void operator()(const datetime_t& date, const amount_t& price) {
all_prices.insert(price_map_t::value_type(date, price));
}
};
diff --git a/src/filters.h b/src/filters.h
index 1404b38e..4aa8af7a 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/flags.h b/src/flags.h
index f3593517..e6b66470 100644
--- a/src/flags.h
+++ b/src/flags.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -90,17 +90,6 @@ public:
void drop_flags(const flags_t arg) {
_flags = static_cast<T>(static_cast<U>(_flags) & static_cast<U>(~arg));
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */)
- {
- ar & _flags;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
template <typename T = boost::uint_least8_t, typename U = T>
@@ -193,17 +182,6 @@ public:
void drop_flags(const flags_t arg) {
_flags.drop_flags(arg);
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */)
- {
- ar & _flags;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
#endif // _FLAGS_H
diff --git a/src/format.cc b/src/format.cc
index 2887a387..b6f0d5ae 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/format.h b/src/format.h
index 6ac4075e..8856905d 100644
--- a/src/format.h
+++ b/src/format.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/generate.cc b/src/generate.cc
index 6503f414..c1ecb007 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/generate.h b/src/generate.h
index b17116fa..d4f13070 100644
--- a/src/generate.h
+++ b/src/generate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/global.cc b/src/global.cc
index c144e3be..6edc69ca 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -110,7 +110,7 @@ global_scope_t::~global_scope_t()
void global_scope_t::parse_init(path init_file)
{
TRACE_START(init, 1, "Read initialization file");
-
+
parse_context_stack_t parsing_context;
parsing_context.push(init_file);
parsing_context.get_current().journal = session().journal.get();
@@ -122,13 +122,13 @@ void global_scope_t::parse_init(path init_file)
throw_(parse_error, _f("Transactions found in initialization file '%1%'")
% init_file);
}
-
+
TRACE_FINISH(init, 1);
}
void global_scope_t::read_init()
{
- // if specified on the command line init_file_ is filled in
+ // if specified on the command line init_file_ is filled in
// global_scope_t::handle_debug_options. If it was specified on the command line
// fail if the file doesn't exist. If no init file was specified
// on the command-line then try the default values, but don't fail if there
@@ -144,6 +144,9 @@ void global_scope_t::read_init()
} else {
if (const char * home_var = std::getenv("HOME")) {
init_file = (path(home_var) / ".ledgerrc");
+ if (! exists(init_file)) {
+ init_file = ("./.ledgerrc");
+ }
} else {
init_file = ("./.ledgerrc");
}
@@ -316,9 +319,6 @@ option_t<global_scope_t> * global_scope_t::lookup_option(const char * p)
case 'd':
OPT(debug_);
break;
- case 'f':
- OPT(full_help);
- break;
case 'h':
OPT_(help);
break;
@@ -502,7 +502,7 @@ void handle_debug_options(int argc, char * argv[])
}
else if (i + 1 < argc && std::strcmp(argv[i], "--debug") == 0) {
#if DEBUG_ON
- _log_level = LOG_DEBUG;
+ _log_level = LOG_DEBUG;
_log_category = argv[i + 1];
i++;
#endif
diff --git a/src/global.h b/src/global.h
index 454fc64e..1a4a3076 100644
--- a/src/global.h
+++ b/src/global.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -129,7 +129,7 @@ public:
out << '-' << Ledger_VERSION_DATE;
out << _(", the command-line accounting tool");
out <<
- _("\n\nCopyright (c) 2003-2015, John Wiegley. All rights reserved.\n\n\
+ _("\n\nCopyright (c) 2003-2016, John Wiegley. All rights reserved.\n\n\
This program is made available under the terms of the BSD Public License.\n\
See LICENSE file included with the distribution for details and disclaimer.");
out << std::endl;
@@ -147,7 +147,6 @@ See LICENSE file included with the distribution for details and disclaimer.");
void visit_man_page() const;
- OPTION_(global_scope_t, full_help, DO() { parent->visit_man_page(); }); // -H
OPTION_(global_scope_t, help, DO() { parent->visit_man_page(); }); // -h
OPTION__
diff --git a/src/history.cc b/src/history.cc
index e3c459f3..25d42b06 100644
--- a/src/history.cc
+++ b/src/history.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -475,7 +475,7 @@ commodity_history_impl_t::find_price(const commodity_t& source,
#endif
vertex_descriptor v = tv;
- for (vertex_descriptor u = predecessorMap[v];
+ for (vertex_descriptor u = predecessorMap[v];
u != v;
v = u, u = predecessorMap[v])
{
diff --git a/src/history.h b/src/history.h
index dd776383..37efb068 100644
--- a/src/history.h
+++ b/src/history.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/item.cc b/src/item.cc
index 9effcd23..0402f467 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/item.h b/src/item.h
index 458cb378..ca16d87b 100644
--- a/src/item.h
+++ b/src/item.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -78,23 +78,6 @@ struct position_t
}
return *this;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & pathname;
- ar & beg_pos;
- ar & beg_line;
- ar & end_pos;
- ar & end_line;
- ar & sequence;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class item_t : public supports_flags<uint_least16_t>, public scope_t
@@ -191,11 +174,7 @@ public:
static bool use_aux_date;
virtual bool has_date() const {
-#if BOOST_VERSION >= 105600
- return _date != NULL;
-#else
- return _date;
-#endif
+ return static_cast<bool>(_date);
}
virtual date_t date() const {
@@ -226,25 +205,6 @@ public:
const string& name);
bool valid() const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<supports_flags<uint_least16_t> >(*this);
- ar & boost::serialization::base_object<scope_t>(*this);
- ar & _state;
- ar & _date;
- ar & _date_aux;
- ar & note;
- ar & pos;
- ar & metadata;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
value_t get_comment(item_t& item);
diff --git a/src/iterators.cc b/src/iterators.cc
index 21bec5d9..88233ea1 100644
--- a/src/iterators.cc
+++ b/src/iterators.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -96,7 +96,7 @@ namespace {
TRACE_DTOR(create_price_xact);
}
- void operator()(datetime_t& date, const amount_t& price) {
+ void operator()(const datetime_t& date, const amount_t& price) {
xact_t * xact;
string symbol = price.commodity().symbol();
diff --git a/src/iterators.h b/src/iterators.h
index 86eb86ca..a3f535b1 100644
--- a/src/iterators.h
+++ b/src/iterators.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/journal.cc b/src/journal.cc
index ae545477..36fe5fc0 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/journal.h b/src/journal.h
index 613b2b96..76e1735d 100644
--- a/src/journal.h
+++ b/src/journal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -100,21 +100,6 @@ public:
~fileinfo_t() throw() {
TRACE_DTOR(journal_t::fileinfo_t);
}
-
-#if HAVE_BOOST_SERIALIZATION
- private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & filename;
- ar & size;
- ar & modtime;
- ar & from_stream;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
account_t * master;
@@ -215,26 +200,6 @@ public:
private:
std::size_t read_textual(parse_context_stack_t& context);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & master;
- ar & bucket;
- ar & xacts;
- ar & auto_xacts;
- ar & period_xacts;
- ar & sources;
- ar & payee_mappings;
- ar & account_mappings;
- ar & checksum_map;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
} // namespace ledger
diff --git a/src/lookup.cc b/src/lookup.cc
index 6dbeb502..11b7db61 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -54,7 +54,7 @@ namespace {
struct usage_sorter {
bool operator()(const account_use_pair& left,
const account_use_pair& right) const {
- return left.second > right.second;
+ return left.second < right.second;
}
};
}
diff --git a/src/lookup.h b/src/lookup.h
index fc7063ec..2c4e6575 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/main.cc b/src/main.cc
index c26a280a..3a36280a 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/mask.cc b/src/mask.cc
index 29b53781..c6868dde 100644
--- a/src/mask.cc
+++ b/src/mask.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/mask.h b/src/mask.h
index 2b579768..f416611f 100644
--- a/src/mask.h
+++ b/src/mask.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -124,25 +124,6 @@ public:
}
return true;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- string temp;
- if (Archive::is_loading::value) {
- ar & temp;
- *this = temp;
- } else {
- temp = str();
- ar & temp;
- }
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline std::ostream& operator<<(std::ostream& out, const mask_t& mask) {
diff --git a/src/op.cc b/src/op.cc
index ff707a14..97437ce3 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/op.h b/src/op.h
index c45ffb08..937b321d 100644
--- a/src/op.h
+++ b/src/op.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -314,33 +314,6 @@ private:
value_t calc_call(scope_t& scope, ptr_op_t * locus, const int depth);
value_t calc_cons(scope_t& scope, ptr_op_t * locus, const int depth);
value_t calc_seq(scope_t& scope, ptr_op_t * locus, const int depth);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & refc;
- ar & kind;
- if (Archive::is_loading::value || ! left_ || ! left_->is_function()) {
- ar & left_;
- } else {
- ptr_op_t temp_op;
- ar & temp_op;
- }
- if (Archive::is_loading::value || is_value() || is_ident() ||
- (kind > UNARY_OPERATORS &&
- (! has_right() || ! right()->is_function()))) {
- ar & data;
- } else {
- variant<ptr_op_t, value_t, string, expr_t::func_t> temp_data;
- ar & temp_data;
- }
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
inline expr_t::ptr_op_t
diff --git a/src/option.cc b/src/option.cc
index 8c003e08..7c5c5e07 100644
--- a/src/option.cc
+++ b/src/option.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/option.h b/src/option.h
index 4646121d..b06c1754 100644
--- a/src/option.h
+++ b/src/option.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/org.cc b/src/org.cc
index 7d11c36a..4d572415 100644
--- a/src/org.cc
+++ b/src/org.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/org.h b/src/org.h
index 40b7685d..da28c772 100644
--- a/src/org.h
+++ b/src/org.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/output.cc b/src/output.cc
index ffd144e1..77083450 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -291,7 +291,7 @@ void report_accounts::flush()
void report_accounts::operator()(post_t& post)
{
- std::map<account_t *, std::size_t>::iterator i = accounts.find(post.account);
+ accounts_report_map::iterator i = accounts.find(post.account);
if (i == accounts.end())
accounts.insert(accounts_pair(post.account, 1));
else
@@ -362,7 +362,7 @@ void report_commodities::operator()(post_t& post)
amount_t temp(post.amount.strip_annotations(report.what_to_keep()));
commodity_t& comm(temp.commodity());
- std::map<commodity_t *, std::size_t>::iterator i = commodities.find(&comm);
+ commodities_report_map::iterator i = commodities.find(&comm);
if (i == commodities.end())
commodities.insert(commodities_pair(&comm, 1));
else
@@ -371,7 +371,7 @@ void report_commodities::operator()(post_t& post)
if (comm.has_annotation()) {
annotated_commodity_t& ann_comm(as_annotated_commodity(comm));
if (ann_comm.details.price) {
- std::map<commodity_t *, std::size_t>::iterator ii =
+ commodities_report_map::iterator ii =
commodities.find(&ann_comm.details.price->commodity());
if (ii == commodities.end())
commodities.insert
diff --git a/src/output.h b/src/output.h
index ec7ec6c2..e8c45337 100644
--- a/src/output.h
+++ b/src/output.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -142,9 +142,10 @@ class report_accounts : public item_handler<post_t>
protected:
report_t& report;
- std::map<account_t *, std::size_t, account_compare> accounts;
-
typedef std::map<account_t *, std::size_t>::value_type accounts_pair;
+ typedef std::map<account_t *, std::size_t, account_compare> accounts_report_map;
+
+ accounts_report_map accounts;
public:
report_accounts(report_t& _report) : report(_report) {
@@ -221,9 +222,10 @@ class report_commodities : public item_handler<post_t>
protected:
report_t& report;
- std::map<commodity_t *, std::size_t, commodity_compare> commodities;
-
typedef std::map<commodity_t *, std::size_t>::value_type commodities_pair;
+ typedef std::map<commodity_t *, std::size_t, commodity_compare> commodities_report_map;
+
+ commodities_report_map commodities;
public:
report_commodities(report_t& _report) : report(_report) {
diff --git a/src/parser.cc b/src/parser.cc
index 8044338f..53b03a0c 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/parser.h b/src/parser.h
index e46fc719..913179a1 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -118,7 +118,7 @@ public:
ptr_op_t parse(std::istream& in,
const parse_flags_t& flags = PARSE_DEFAULT,
- const optional<string>& original_string = NULL);
+ const optional<string>& original_string = boost::none);
};
} // namespace ledger
diff --git a/src/pool.cc b/src/pool.cc
index 95c0f49d..dff02df8 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pool.h b/src/pool.h
index d24df78c..945fd083 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -78,8 +78,8 @@ public:
commodity_t * default_commodity;
bool keep_base; // --base
- optional<path> price_db; // --price-db=
- long quote_leeway; // --leeway=
+ optional<path> price_db; // --price-db=
+ long quote_leeway; // --leeway=
bool get_quotes; // --download
function<optional<price_point_t>
@@ -132,26 +132,6 @@ public:
parse_price_expression(const std::string& str,
const bool add_prices = true,
const optional<datetime_t>& moment = none);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & current_pool;
- ar & commodities;
- ar & annotated_commodities;
- ar & null_commodity;
- ar & default_commodity;
- ar & keep_base;
- ar & price_db;
- ar & quote_leeway;
- ar & get_quotes;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
} // namespace ledger
diff --git a/src/post.cc b/src/post.cc
index 269e2e6c..8d2693c7 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/post.h b/src/post.h
index 1e5fc569..d7d8f7c4 100644
--- a/src/post.h
+++ b/src/post.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -205,11 +205,7 @@ public:
mutable optional<xdata_t> xdata_;
bool has_xdata() const {
-#if BOOST_VERSION >= 105600
- return xdata_ != NULL;
-#else
- return xdata_;
-#endif
+ return static_cast<bool>(xdata_);
}
void clear_xdata() {
xdata_ = none;
@@ -255,24 +251,6 @@ public:
}
}
};
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<item_t>(*this);
- ar & xact;
- ar & account;
- ar & amount;
- ar & amount_expr;
- ar & cost;
- ar & assigned_amount;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class journal_t;
diff --git a/src/precmd.cc b/src/precmd.cc
index 2da6ba8e..af8c5ee0 100644
--- a/src/precmd.cc
+++ b/src/precmd.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/precmd.h b/src/precmd.h
index bf2732d7..365cc1ba 100644
--- a/src/precmd.h
+++ b/src/precmd.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/predicate.h b/src/predicate.h
index 30d07223..aca44452 100644
--- a/src/predicate.h
+++ b/src/predicate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -90,19 +90,6 @@ public:
.to_boolean() :
true);
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<expr_t>(*this);
- ar & what_to_keep;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
} // namespace ledger
diff --git a/src/print.cc b/src/print.cc
index 02e518f7..0cc23275 100644
--- a/src/print.cc
+++ b/src/print.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/print.h b/src/print.h
index c587b499..70b26d65 100644
--- a/src/print.h
+++ b/src/print.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pstream.h b/src/pstream.h
index 3b669aca..fc7fc8ca 100644
--- a/src/pstream.h
+++ b/src/pstream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/ptree.cc b/src/ptree.cc
index 3efe4451..534db003 100644
--- a/src/ptree.cc
+++ b/src/ptree.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/ptree.h b/src/ptree.h
index 36708dcf..ca7b46e2 100644
--- a/src/ptree.h
+++ b/src/ptree.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_account.cc b/src/py_account.cc
index 1cc28b92..c4a9ae07 100644
--- a/src/py_account.cc
+++ b/src/py_account.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_amount.cc b/src/py_amount.cc
index 84558a29..8a8ea871 100644
--- a/src/py_amount.cc
+++ b/src/py_amount.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_balance.cc b/src/py_balance.cc
index 98ed8c60..6a6c59fb 100644
--- a/src/py_balance.cc
+++ b/src/py_balance.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index 27a0e105..5aafa6ce 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -243,6 +243,9 @@ namespace {
void export_commodity()
{
+#if BOOST_VERSION >= 106000
+ python::register_ptr_to_python< shared_ptr<commodity_pool_t> >();
+#endif
class_< commodity_pool_t, shared_ptr<commodity_pool_t>,
boost::noncopyable > ("CommodityPool", no_init)
.add_property("null_commodity",
diff --git a/src/py_expr.cc b/src/py_expr.cc
index 803388f2..de3ac925 100644
--- a/src/py_expr.cc
+++ b/src/py_expr.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_format.cc b/src/py_format.cc
index 6086d6cb..4dcd4ba3 100644
--- a/src/py_format.cc
+++ b/src/py_format.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_item.cc b/src/py_item.cc
index 473bbef8..644b11f1 100644
--- a/src/py_item.cc
+++ b/src/py_item.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,6 +32,7 @@
#include <system.hh>
#include "pyinterp.h"
+#include "pyutils.h"
#include "scope.h"
#include "mask.h"
#include "item.h"
@@ -64,6 +65,13 @@ namespace {
return item.get_tag(tag_mask, value_mask);
}
+ std::string py_position_pathname(position_t const& pos) {
+ return pos.pathname.native();
+ }
+ void py_position_set_pathname(position_t& pos, string const& s) {
+ pos.pathname = s;
+ }
+
} // unnamed namespace
#if 0
@@ -79,8 +87,8 @@ void export_item()
{
class_< position_t > ("Position")
.add_property("pathname",
- make_getter(&position_t::pathname),
- make_setter(&position_t::pathname))
+ make_function(py_position_pathname),
+ make_function(py_position_set_pathname))
.add_property("beg_pos",
make_getter(&position_t::beg_pos),
make_setter(&position_t::beg_pos))
@@ -169,6 +177,8 @@ void export_item()
.def("valid", &item_t::valid)
;
+
+ register_optional_to_python<position_t>();
}
} // namespace ledger
diff --git a/src/py_journal.cc b/src/py_journal.cc
index abbcd866..c1c38a90 100644
--- a/src/py_journal.cc
+++ b/src/py_journal.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -232,6 +232,9 @@ void export_journal()
boost::noncopyable >("PostHandler")
;
+#if BOOST_VERSION >= 106000
+ python::register_ptr_to_python< shared_ptr<collector_wrapper> >();
+#endif
class_< collector_wrapper, shared_ptr<collector_wrapper>,
boost::noncopyable >("PostCollectorWrapper", no_init)
.def("__len__", &collector_wrapper::length)
diff --git a/src/py_post.cc b/src/py_post.cc
index 851828c7..85d4701a 100644
--- a/src/py_post.cc
+++ b/src/py_post.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_session.cc b/src/py_session.cc
index f6053180..0ddf66d2 100644
--- a/src/py_session.cc
+++ b/src/py_session.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_times.cc b/src/py_times.cc
index 906dcfaa..be3e4f31 100644
--- a/src/py_times.cc
+++ b/src/py_times.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_utils.cc b/src/py_utils.cc
index df87bded..731294b2 100644
--- a/src/py_utils.cc
+++ b/src/py_utils.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_value.cc b/src/py_value.cc
index 2828e3b8..60ba4cf2 100644
--- a/src/py_value.cc
+++ b/src/py_value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_xact.cc b/src/py_xact.cc
index 5b4c14d4..f7283989 100644
--- a/src/py_xact.cc
+++ b/src/py_xact.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyfstream.h b/src/pyfstream.h
index 11f514a2..a90b121c 100644
--- a/src/pyfstream.h
+++ b/src/pyfstream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index 54e62946..81924c86 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyinterp.h b/src/pyinterp.h
index 32becbf6..9c24b0cf 100644
--- a/src/pyinterp.h
+++ b/src/pyinterp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -77,7 +77,7 @@ public:
if (name != "__main__")
main_module->define_global(name, mod->module_object);
return mod;
- }
+ }
python_interpreter_t() : session_t(), is_initialized(false) {
TRACE_CTOR(python_interpreter_t, "");
diff --git a/src/pyledger.cc b/src/pyledger.cc
index 1f478dec..a516f66d 100644
--- a/src/pyledger.cc
+++ b/src/pyledger.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyutils.h b/src/pyutils.h
index 039b2605..07ce7bdd 100644
--- a/src/pyutils.h
+++ b/src/pyutils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/query.cc b/src/query.cc
index 04b18581..a2117cfe 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/query.h b/src/query.h
index b7608bc7..cbfac6bc 100644
--- a/src/query.h
+++ b/src/query.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/quotes.cc b/src/quotes.cc
index 6d179287..2777974e 100644
--- a/src/quotes.cc
+++ b/src/quotes.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/quotes.h b/src/quotes.h
index c14bc495..b3978171 100644
--- a/src/quotes.h
+++ b/src/quotes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/report.cc b/src/report.cc
index 2ce70151..9e480ea5 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -1198,6 +1198,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
OPT_CH(collapse);
else OPT(no_color);
else OPT(no_pager);
+ else OPT(no_revalued);
else OPT(no_rounding);
else OPT(no_titles);
else OPT(no_total);
diff --git a/src/report.h b/src/report.h
index 67e95884..0873e64f 100644
--- a/src/report.h
+++ b/src/report.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -403,6 +403,7 @@ public:
OPTION(report_t, auto_match);
OPTION_(report_t, average, DO() { // -A
+ OTHER(empty).on(whence);
OTHER(display_total_)
.on(whence, "count>0?(display_total/count):0");
});
@@ -496,7 +497,7 @@ public:
"%-(ansify_if(partial_account(options.flat), blue if color))\n%/"
"%$1 %$2 %$3\n%/"
"%(prepend_width ? \" \" * int(prepend_width) : \"\")"
- "---------------- ---------------- ---------\n");
+ "---------------- ---------------- ---------\n");
});
OPTION(report_t, color);
@@ -764,6 +765,10 @@ public:
OTHER(color).off();
});
+ OPTION_(report_t, no_revalued, DO() {
+ OTHER(revalued).off();
+ });
+
OPTION(report_t, no_rounding);
OPTION(report_t, no_titles);
OPTION(report_t, no_total);
diff --git a/src/scope.cc b/src/scope.cc
index 3ca9e0c0..03387549 100644
--- a/src/scope.cc
+++ b/src/scope.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/scope.h b/src/scope.h
index 8ad3afac..147b400f 100644
--- a/src/scope.h
+++ b/src/scope.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -83,20 +83,6 @@ struct symbol_t
bool operator==(const symbol_t& sym) const {
return kind == sym.kind || name == sym.name;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & kind;
- ar & name;
- ar & definition;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class empty_scope_t;
@@ -127,16 +113,6 @@ public:
virtual bool type_required() const {
return false;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive&, const unsigned int /* version */) {}
-#endif // HAVE_BOOST_SERIALIZATION
};
class empty_scope_t : public scope_t
@@ -184,19 +160,6 @@ public:
return parent->lookup(kind, name);
return NULL;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<scope_t>(*this);
- ar & parent;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class bind_scope_t : public child_scope_t
@@ -233,19 +196,6 @@ public:
return def;
return child_scope_t::lookup(kind, name);
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<child_scope_t>(*this);
- ar & grandchild;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
template <typename T>
@@ -323,19 +273,6 @@ public:
virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind,
const string& name);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<child_scope_t>(*this);
- ar & symbols;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class context_scope_t : public child_scope_t
@@ -365,24 +302,6 @@ public:
virtual bool type_required() const {
return required;
}
-
-#if HAVE_BOOST_SERIALIZATION
-protected:
- explicit context_scope_t() {
- TRACE_CTOR(context_scope_t, "");
- }
-
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<child_scope_t>(*this);
- ar & value_type_context;
- ar & required;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class call_scope_t : public context_scope_t
@@ -480,24 +399,6 @@ public:
bool empty() const {
return args.size() == 0;
}
-
-#if HAVE_BOOST_SERIALIZATION
-protected:
- explicit call_scope_t() : depth(0) {
- TRACE_CTOR(call_scope_t, "");
- }
-
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<context_scope_t>(*this);
- ar & args;
- //ar & ptr;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
template <>
diff --git a/src/select.cc b/src/select.cc
index 81800f16..1c69b2bf 100644
--- a/src/select.cc
+++ b/src/select.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -396,7 +396,7 @@ value_t select_command(call_scope_t& args)
#if 0
query_t query;
keep_details_t keeper(true, true, true);
- expr_t::ptr_op_t expr =
+ expr_t::ptr_op_t expr =
query.parse_args(string_value(arg).to_sequence(), keeper, false, true);
report.HANDLER(limit_).on("#select", query.get_query(query_t::QUERY_LIMIT));
#else
diff --git a/src/select.h b/src/select.h
index c95e15f7..89d7c989 100644
--- a/src/select.h
+++ b/src/select.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/session.cc b/src/session.cc
index b0d31be9..8d03431f 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -37,7 +37,6 @@
#include "journal.h"
#include "iterators.h"
#include "filters.h"
-#include "archive.h"
namespace ledger {
@@ -129,56 +128,13 @@ std::size_t session_t::read_data(const string& master_account)
if (HANDLED(value_expr_))
journal->value_expr = HANDLER(value_expr_).str();
-#if HAVE_BOOST_SERIALIZATION
- optional<archive_t> cache;
- if (HANDLED(cache_) && master_account.empty())
- cache = archive_t(HANDLED(cache_).str());
-
- if (! (cache &&
- cache->should_load(HANDLER(file_).data_files) &&
- cache->load(*journal.get()))) {
-#endif // HAVE_BOOST_SERIALIZATION
- if (price_db_path) {
- if (exists(*price_db_path)) {
- parsing_context.push(*price_db_path);
- parsing_context.get_current().journal = journal.get();
- try {
- if (journal->read(parsing_context) > 0)
- throw_(parse_error, _("Transactions not allowed in price history file"));
- }
- catch (...) {
- parsing_context.pop();
- throw;
- }
- parsing_context.pop();
- }
- }
-
- foreach (const path& pathname, HANDLER(file_).data_files) {
- if (pathname == "-" || pathname == "/dev/stdin") {
- // To avoid problems with stdin and pipes, etc., we read the entire
- // file in beforehand into a memory buffer, and then parcel it out
- // from there.
- std::ostringstream buffer;
-
- while (std::cin.good() && ! std::cin.eof()) {
- char line[8192];
- std::cin.read(line, 8192);
- std::streamsize count = std::cin.gcount();
- buffer.write(line, count);
- }
- buffer.flush();
-
- shared_ptr<std::istream> stream(new std::istringstream(buffer.str()));
- parsing_context.push(stream);
- } else {
- parsing_context.push(pathname);
- }
-
+ if (price_db_path) {
+ if (exists(*price_db_path)) {
+ parsing_context.push(*price_db_path);
parsing_context.get_current().journal = journal.get();
- parsing_context.get_current().master = acct;
try {
- xact_count += journal->read(parsing_context);
+ if (journal->read(parsing_context) > 0)
+ throw_(parse_error, _("Transactions not allowed in price history file"));
}
catch (...) {
parsing_context.pop();
@@ -186,16 +142,44 @@ std::size_t session_t::read_data(const string& master_account)
}
parsing_context.pop();
}
+ }
+
+ foreach (const path& pathname, HANDLER(file_).data_files) {
+ if (pathname == "-" || pathname == "/dev/stdin") {
+ // To avoid problems with stdin and pipes, etc., we read the entire
+ // file in beforehand into a memory buffer, and then parcel it out
+ // from there.
+ std::ostringstream buffer;
+
+ while (std::cin.good() && ! std::cin.eof()) {
+ char line[8192];
+ std::cin.read(line, 8192);
+ std::streamsize count = std::cin.gcount();
+ buffer.write(line, count);
+ }
+ buffer.flush();
- DEBUG("ledger.read", "xact_count [" << xact_count
- << "] == journal->xacts.size() [" << journal->xacts.size() << "]");
- assert(xact_count == journal->xacts.size());
+ shared_ptr<std::istream> stream(new std::istringstream(buffer.str()));
+ parsing_context.push(stream);
+ } else {
+ parsing_context.push(pathname);
+ }
-#if HAVE_BOOST_SERIALIZATION
- if (cache && cache->should_save(*journal.get()))
- cache->save(*journal.get());
+ parsing_context.get_current().journal = journal.get();
+ parsing_context.get_current().master = acct;
+ try {
+ xact_count += journal->read(parsing_context);
+ }
+ catch (...) {
+ parsing_context.pop();
+ throw;
+ }
+ parsing_context.pop();
}
-#endif // HAVE_BOOST_SERIALIZATION
+
+ DEBUG("ledger.read", "xact_count [" << xact_count
+ << "] == journal->xacts.size() [" << journal->xacts.size() << "]");
+ assert(xact_count == journal->xacts.size());
if (populated_data_files)
HANDLER(file_).data_files.clear();
@@ -333,8 +317,7 @@ option_t<session_t> * session_t::lookup_option(const char * p)
OPT_CH(price_exp_);
break;
case 'c':
- OPT(cache_);
- else OPT(check_payees);
+ OPT(check_payees);
break;
case 'd':
OPT(download); // -Q
diff --git a/src/session.h b/src/session.h
index b287b19e..3d35a93e 100644
--- a/src/session.h
+++ b/src/session.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -97,7 +97,6 @@ public:
void report_options(std::ostream& out)
{
- HANDLER(cache_).report(out);
HANDLER(check_payees).report(out);
HANDLER(day_break).report(out);
HANDLER(download).report(out);
@@ -126,7 +125,6 @@ public:
* Option handlers
*/
- OPTION(session_t, cache_);
OPTION(session_t, check_payees);
OPTION(session_t, day_break);
OPTION(session_t, download); // -Q
diff --git a/src/stats.cc b/src/stats.cc
index 406ecd3b..2d1f8dc7 100644
--- a/src/stats.cc
+++ b/src/stats.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stats.h b/src/stats.h
index f0408591..dfb9e796 100644
--- a/src/stats.h
+++ b/src/stats.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stream.cc b/src/stream.cc
index c5a40e87..60b0dc55 100644
--- a/src/stream.cc
+++ b/src/stream.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stream.h b/src/stream.h
index 05572cb4..996cffb1 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/strptime.cc b/src/strptime.cc
index b64af96b..b31954f4 100644
--- a/src/strptime.cc
+++ b/src/strptime.cc
@@ -85,7 +85,7 @@ static char* _strptime(const char *s, const char *format, struct tm *tm) {
if (tm->tm_wday == -1) return NULL;
s += len;
break;
-
+
// month name.
case 'b':
case 'B':
diff --git a/src/system.hh.in b/src/system.hh.in
index eaf4b1ac..54bcf7a9 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -71,7 +71,7 @@
#define HAVE_BOOST_PYTHON @HAVE_BOOST_PYTHON@
#define HAVE_BOOST_REGEX_UNICODE @HAVE_BOOST_REGEX_UNICODE@
-#define HAVE_BOOST_SERIALIZATION 0
+#define HAVE_BOOST_159_ISSUE_39 @HAVE_BOOST_159_ISSUE_39@
#define DEBUG_MODE @DEBUG_MODE@
#define NO_ASSERTS @NO_ASSERTS@
@@ -239,86 +239,8 @@ typedef std::ostream::pos_type ostream_pos_type;
#endif
#define _f(str) boost::format(_(str))
-#if HAVE_BOOST_SERIALIZATION
-
-#include <boost/archive/binary_iarchive.hpp>
-#include <boost/archive/binary_oarchive.hpp>
-
-#include <boost/serialization/base_object.hpp>
-#include <boost/serialization/binary_object.hpp>
-#include <boost/serialization/optional.hpp>
-#include <boost/serialization/shared_ptr.hpp>
-#include <boost/serialization/variant.hpp>
-#include <boost/serialization/utility.hpp>
-#include <boost/serialization/export.hpp>
-#include <boost/serialization/level.hpp>
-#include <boost/serialization/string.hpp>
-#include <boost/serialization/vector.hpp>
-#include <boost/serialization/deque.hpp>
-#include <boost/serialization/list.hpp>
-#include <boost/serialization/map.hpp>
-
-#include <boost/date_time/posix_time/time_serialize.hpp>
-#include <boost/date_time/gregorian/greg_serialize.hpp>
-#include <boost/ptr_container/serialize_ptr_deque.hpp>
-
-namespace boost {
-namespace serialization {
-
-template <class Archive>
-void serialize(Archive& ar, boost::filesystem::path& p, const unsigned int)
-{
- std::string s;
- if (Archive::is_saving::value)
- s = p.string();
-
- ar & s;
-
- if (Archive::is_loading::value)
- p = s;
-}
-
-template <class Archive, class T>
-void serialize(Archive& ar, boost::intrusive_ptr<T>& ptr, const unsigned int)
-{
- if (Archive::is_saving::value) {
- T * p = ptr.get();
- ar & p;
- }
- else if (Archive::is_loading::value) {
- T * p;
- ar & p;
- ptr.reset(p);
- }
-}
-
-template <class Archive>
-void serialize(Archive&, boost::any&, const unsigned int) {
- // jww (2012-03-29): Should we really ignore any fields entirely?
- // These occur inside value_t::storage_t::data's variant.
-}
-
-template <class Archive>
-void serialize(Archive&, boost::blank&, const unsigned int) {}
-
-template <class Archive, class T>
-void serialize(Archive&, boost::function<T>&, const unsigned int) {}
-
-template <class Archive>
-void serialize(Archive& ar, istream_pos_type& pos, const unsigned int)
-{
- ar & make_binary_object(&pos, sizeof(istream_pos_type));
-}
-
-} // namespace serialization
-} // namespace boost
-
-#else // HAVE_BOOST_SERIALIZATION
-
#include <boost/ptr_container/ptr_deque.hpp>
-#endif // HAVE_BOOST_SERIALIZATION
-
#if HAVE_BOOST_PYTHON
#include <boost/python.hpp>
@@ -332,6 +254,17 @@ void serialize(Archive& ar, istream_pos_type& pos, const unsigned int)
#include <boost/iterator/indirect_iterator.hpp>
+#if BOOST_VERSION == 105900 && HAVE_BOOST_159_ISSUE_39
+// Fix for https://github.com/boostorg/python/issues/39
+namespace boost { namespace python {
+template <class D>
+inline object make_setter(D const& x)
+{
+ return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
+}
+}}
+#endif
+
#endif // HAVE_BOOST_PYTHON
#endif // _SYSTEM_HH
diff --git a/src/temps.cc b/src/temps.cc
index 15ccbc3a..b8e7bfb6 100644
--- a/src/temps.cc
+++ b/src/temps.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/temps.h b/src/temps.h
index 77a7824e..eb2b9b23 100644
--- a/src/temps.h
+++ b/src/temps.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/textual.cc b/src/textual.cc
index 8007ca0d..ccd87ca0 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/timelog.cc b/src/timelog.cc
index 91ee2697..870a4b4b 100644
--- a/src/timelog.cc
+++ b/src/timelog.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/timelog.h b/src/timelog.h
index af621ee6..95a87eae 100644
--- a/src/timelog.h
+++ b/src/timelog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/times.cc b/src/times.cc
index b6c15dc3..b9c8fc01 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/times.h b/src/times.h
index c1bfb1cc..df833958 100644
--- a/src/times.h
+++ b/src/times.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -153,20 +153,6 @@ struct date_traits_t
has_month == traits.has_month &&
has_day == traits.has_day);
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & has_year;
- ar & has_month;
- ar & has_day;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
struct date_duration_t
@@ -247,19 +233,6 @@ struct date_duration_t
}
static date_t find_nearest(const date_t& date, skip_quantum_t skip);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & quantum;
- ar & length;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class date_specifier_t
@@ -343,21 +316,6 @@ public:
return out.str();
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & year;
- ar & month;
- ar & day;
- ar & wday;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class date_range_t
@@ -420,20 +378,6 @@ public:
return out.str();
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & range_begin;
- ar & range_end;
- ar & end_inclusive;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class date_specifier_or_range_t
@@ -490,18 +434,6 @@ public:
return out.str();
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & specifier_or_range;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class date_interval_t : public equality_comparable<date_interval_t>
@@ -568,11 +500,7 @@ public:
void stabilize(const optional<date_t>& date = none);
bool is_valid() const {
-#if BOOST_VERSION >= 105600
- return start != NULL;
-#else
- return start;
-#endif
+ return static_cast<bool>(start);
}
/** Find the current or next period containing date. Returns false if
@@ -594,24 +522,6 @@ public:
date_interval_t& operator++();
void dump(std::ostream& out);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & range;
- ar & start;
- ar & finish;
- ar & aligned;
- ar & next;
- ar & duration;
- ar & end_of_duration;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
void times_initialize();
diff --git a/src/token.cc b/src/token.cc
index 9fe7873f..0bbff6ea 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/token.h b/src/token.h
index 3fe249aa..b9ccde86 100644
--- a/src/token.h
+++ b/src/token.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/unistring.h b/src/unistring.h
index 3f459d83..fc37c9f2 100644
--- a/src/unistring.h
+++ b/src/unistring.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/utils.cc b/src/utils.cc
index 9b528f54..947f2408 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/utils.h b/src/utils.h
index b92a6f49..42ea2ae9 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/value.cc b/src/value.cc
index 2737add9..878d7349 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -341,6 +341,10 @@ value_t& value_t::operator+=(const value_t& val)
}
switch (type()) {
+ case VOID:
+ *this = value_t(val);
+ return *this;
+
case DATETIME:
switch (val.type()) {
case INTEGER:
diff --git a/src/value.h b/src/value.h
index c224ce04..eb0c7c76 100644
--- a/src/value.h
+++ b/src/value.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -227,20 +227,6 @@ public:
data = false;
type = VOID;
}
-
-#if HAVE_BOOST_SERIALIZATION
- private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & data;
- ar & type;
- ar & refc;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
private:
@@ -449,7 +435,7 @@ public:
return temp;
}
void in_place_roundto(int places);
-
+
value_t truncated() const {
value_t temp(*this);
temp.in_place_truncate();
@@ -965,20 +951,6 @@ public:
* Debugging methods.
*/
bool valid() const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & true_value;
- ar & false_value;
- ar & storage;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
#define NULL_VALUE (value_t())
diff --git a/src/views.cc b/src/views.cc
index 61b824cd..65d21a9a 100644
--- a/src/views.cc
+++ b/src/views.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/views.h b/src/views.h
index 2be3d978..070ac22d 100644
--- a/src/views.h
+++ b/src/views.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -235,7 +235,7 @@ public:
optional<string> note() const {
return ptr()->note;
}
-
+
bool has_tag(const string& tag) const {
return ptr()->has_tag(tag);
}
diff --git a/src/wcwidth.cc b/src/wcwidth.cc
index c23f83d7..75cd76be 100644
--- a/src/wcwidth.cc
+++ b/src/wcwidth.cc
@@ -195,7 +195,7 @@ int mk_wcwidth(boost::uint32_t ucs)
/* if we arrive here, ucs is not a combining or C0/C1 control character */
- return 1 +
+ return 1 +
(ucs >= 0x1100 &&
(ucs <= 0x115f || /* Hangul Jamo init. consonants */
ucs == 0x2329 || ucs == 0x232a ||
diff --git a/src/xact.cc b/src/xact.cc
index 5369c138..2524889d 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/xact.h b/src/xact.h
index 3ca57953..a43246ee 100644
--- a/src/xact.h
+++ b/src/xact.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2015, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -87,20 +87,6 @@ public:
virtual bool valid() const {
return true;
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<item_t>(*this);
- ar & journal;
- ar & posts;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class xact_t : public xact_base_t
@@ -142,20 +128,6 @@ public:
const string& name);
virtual bool valid() const;
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<xact_base_t>(*this);
- ar & code;
- ar & payee;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class auto_xact_t : public xact_base_t
@@ -176,21 +148,6 @@ public:
bool _overwrite_existing)
: tag_data(_tag_data), overwrite_existing(_overwrite_existing),
apply_to_post(NULL) {}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
- deferred_tag_data_t() : apply_to_post(NULL) {}
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & tag_data;
- ar & overwrite_existing;
- ar & apply_to_post;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
typedef std::list<deferred_tag_data_t> deferred_notes_list;
@@ -236,21 +193,6 @@ private:
}
virtual void extend_xact(xact_base_t& xact, parse_context_t& context);
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<xact_base_t>(*this);
- ar & predicate;
- ar & check_exprs;
- ar & deferred_notes;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
class period_xact_t : public xact_base_t
@@ -284,20 +226,6 @@ class period_xact_t : public xact_base_t
return string(_("generated periodic transaction"));
}
}
-
-#if HAVE_BOOST_SERIALIZATION
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & boost::serialization::base_object<xact_base_t>(*this);
- ar & period;
- ar & period_string;
- }
-#endif // HAVE_BOOST_SERIALIZATION
};
typedef std::list<xact_t *> xacts_list;