5 #include "../version.h"
\r
7 #include "utility/string_convert.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
28 std::string initialPath = boost::filesystem::initial_path().file_string();
\r
30 boost::property_tree::read_xml(initialPath + "\\caspar.config", 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 = widen(paths.get("template-host-path", initialPath + "\\template\\cg.fth"));
\r
37 data = widen(paths.get("data-path", initialPath + "\\data\\"));
\r
42 static boost::once_flag setup_flag = BOOST_ONCE_INIT;
\r
43 boost::call_once(do_setup, setup_flag);
\r
46 const std::wstring& env::media_folder()
\r
52 const std::wstring& env::log_folder()
\r
58 const std::wstring& env::template_folder()
\r
64 const std::wstring& env::template_host()
\r
67 return ftemplate_host;
\r
71 const std::wstring& env::data_folder()
\r
77 const std::wstring& env::version()
\r
79 static std::wstring ver = std::wstring(L"") + CASPAR_GEN + L"." + CASPAR_MAYOR + L"." + CASPAR_MINOR + L"." + CASPAR_REV;
\r
83 const std::wstring& env::version_tag()
\r
85 static std::wstring tag = L"Experimental";
\r
89 const boost::property_tree::ptree& env::properties()
\r