#define INFOSTRUCT_HPP
#include <string>
struct INFO
{
unsigned m_Type ;
std::string m_Desc ;
std::string m_User ;
std::string m_Pass ;
std::string m_Server ;
void load(const std::string & fileName) ;
void save(const std::string & fileName) ;
} ;
#endif // INFOSTRUCT_HPP
and this is the .cpp file:
#include <boost/property_tree/ptree.hpp>#include <boost/property_tree/xml_parser.hpp>#include "infoStruct.hpp"void INFO::load(const std::string &fileName){
boost::property_tree::ptree pTree ;boost::property_tree::xml_parser::read_xml(fileName, pTree) ;m_Type = pTree.get("Database.Driver", 0) ;m_Pass = pTree.get < std::string>("Database.Pass") ;}
void INFO::save(const std::string &fileName){
return ;}
But when I compile this I get lots and lots of compiler errors this most significant of those being:..\..\Includes\boost/property_tree/detail/ptree_implementation.hpp(52): error #501: argument of type "const std::string std::_Pair_base<const std::string, boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string>>>::*" is incompatible with template parameter of type "const std::string std::pair<const std::string, boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string>>>::*"&value_type::first>,
^
detected during:
instantiation of class "boost::property_tree::basic_ptree<Key, Data, KeyCompare>::subs [with Key=std::string, Data=std::string, KeyCompare=std::less<std::string>]" at line 182
instantiation of "boost::property_tree::basic_ptree<Key, Data, KeyCompare>::basic_ptree() [with Key=std::string, Data=std::string, KeyCompare=std::less<std::string>]" at line 8 of "..\DataFactory\infoStruct.cpp"
With the line in question being : boost::property_tree::ptree pTree ;
I honestly cannot see where or what I am doing wrong, so I am hoping someone here can help me.
--
Bill