5 #include "utility/string_convert.h"
\r
7 #include <boost/property_tree/ptree.hpp>
\r
8 #include <boost/property_tree/xml_parser.hpp>
\r
9 #include <boost/filesystem.hpp>
\r
10 #include <boost/thread/once.hpp>
\r
12 #include <functional>
\r
19 std::wstring ftemplate;
\r
20 std::wstring ftemplate_host;
\r
22 boost::property_tree::ptree pt;
\r
26 std::string initialPath = boost::filesystem::initial_path().file_string();
\r
28 boost::property_tree::read_xml(initialPath + "\\caspar.config", pt);
\r
30 auto paths = pt.get_child("configuration.paths");
\r
31 media = widen(paths.get("media-path", initialPath + "\\media\\"));
\r
32 log = widen(paths.get("log-path", initialPath + "\\log\\"));
\r
33 ftemplate = widen(paths.get("template-path", initialPath + "\\template\\"));
\r
34 ftemplate_host = widen(paths.get("template-host-path", initialPath + "\\template\\cg.fth"));
\r
35 data = widen(paths.get("data-path", initialPath + "\\data\\"));
\r
40 static boost::once_flag setup_flag = BOOST_ONCE_INIT;
\r
41 boost::call_once(do_setup, setup_flag);
\r
44 const std::wstring& env::media_folder()
\r
50 const std::wstring& env::log_folder()
\r
56 const std::wstring& env::template_folder()
\r
62 const std::wstring& env::template_host()
\r
65 return ftemplate_host;
\r
69 const std::wstring& env::data_folder()
\r
75 const std::wstring& env::version()
\r
77 static std::wstring ver = L"2.0.0.2";
\r
81 const std::wstring& env::version_tag()
\r
83 static std::wstring tag = L"Experimental";
\r
87 const boost::property_tree::ptree& env::properties()
\r