5 #include "../version.h"
\r
7 #include "utility/string.h"
\r
9 #include <boost/property_tree/ptree.hpp>
\r
10 #include <boost/property_tree/xml_parser.hpp>
\r
11 #include <boost/filesystem.hpp>
\r
12 #include <boost/thread/once.hpp>
\r
14 #include <functional>
\r
21 std::wstring ftemplate;
\r
22 std::wstring ftemplate_host;
\r
24 boost::property_tree::ptree pt;
\r
26 void env::initialize(const std::string& filename)
\r
28 std::string initialPath = boost::filesystem::initial_path().file_string();
\r
30 boost::property_tree::read_xml(initialPath + "\\" + filename, pt);
\r
32 auto paths = pt.get_child("configuration.paths");
\r
33 media = widen(paths.get("media-path", initialPath + "\\media\\"));
\r
34 log = widen(paths.get("log-path", initialPath + "\\log\\"));
\r
35 ftemplate = widen(paths.get("template-path", initialPath + "\\template\\"));
\r
36 ftemplate_host = ftemplate + L"\\" + widen(paths.get("template-host", "cg.fth"));
\r
37 data = widen(paths.get("data-path", initialPath + "\\data\\"));
\r
40 const std::wstring& env::media_folder()
\r
45 const std::wstring& env::log_folder()
\r
50 const std::wstring& env::template_folder()
\r
55 const std::wstring& env::template_host()
\r
57 return ftemplate_host;
\r
61 const std::wstring& env::data_folder()
\r
66 const std::wstring& env::version()
\r
68 static std::wstring ver = std::wstring(L"") + CASPAR_GEN + L"." + CASPAR_MAYOR + L"." + CASPAR_MINOR + L"." + CASPAR_REV;
\r
72 const boost::property_tree::ptree& env::properties()
\r