Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. MySQLInterface::MySQLInterface(const char* configfile)
  2. {
  3. TiXmlDocument doc;
  4. if (!doc.LoadFile(configfile))
  5. return;
  6.  
  7. TiXmlHandle handle(&doc);
  8. auto child = handle.FirstChildElement("database");
  9.  
  10. auto element = child.ToElement();
  11.  
  12. if (element == NULL)
  13. return;
  14.  
  15. hostname = element->Attribute("host");
  16. port = atol(element->Attribute("port"));
  17. username = element->Attribute("user");
  18. password = element->Attribute("pass");
  19. database = element->Attribute("database");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement