diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-01 01:31:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-01 01:31:35 +0200 |
| commit | 8963f0007af1a312017b9627c18b82ec2a577591 (patch) | |
| tree | baeb6f2c17da72248408b8c1d695242b44edda9e /src/lib/analytics.cc | |
| parent | 29f84e2b8785585885e0658bdf9938967547460f (diff) | |
C++11 tidying.
Diffstat (limited to 'src/lib/analytics.cc')
| -rw-r--r-- | src/lib/analytics.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/analytics.cc b/src/lib/analytics.cc index f20b213e4..ac0abc222 100644 --- a/src/lib/analytics.cc +++ b/src/lib/analytics.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington <cth@carlh.net> + Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,33 +18,37 @@ */ + #include "analytics.h" -#include "exceptions.h" #include "compose.hpp" +#include "exceptions.h" #include "warnings.h" #include <dcp/raw_convert.h> #include <libcxml/cxml.h> DCPOMATIC_DISABLE_WARNINGS #include <libxml++/libxml++.h> DCPOMATIC_ENABLE_WARNINGS -#include <boost/filesystem.hpp> #include <boost/algorithm/string.hpp> +#include <boost/filesystem.hpp> #include "i18n.h" + using std::string; using dcp::raw_convert; using boost::algorithm::trim; + Analytics* Analytics::_instance; int const Analytics::_current_version = 1; + Analytics::Analytics () - : _successful_dcp_encodes (0) { } + void Analytics::successful_dcp_encode () { @@ -81,11 +85,12 @@ Analytics::successful_dcp_encode () } } + void Analytics::write () const { xmlpp::Document doc; - xmlpp::Element* root = doc.create_root_node ("Analytics"); + auto root = doc.create_root_node ("Analytics"); root->add_child("Version")->add_child_text(raw_convert<string>(_current_version)); root->add_child("SuccessfulDCPEncodes")->add_child_text(raw_convert<string>(_successful_dcp_encodes)); @@ -99,6 +104,7 @@ Analytics::write () const } } + void Analytics::read () try @@ -110,6 +116,7 @@ try /* Never mind */ } + Analytics* Analytics::instance () { |
