AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MySQLConnectionInfo Struct Reference

#include "MySQLConnection.h"

Public Member Functions

 MySQLConnectionInfo (std::string_view infoString)
 

Public Attributes

std::string user
 
std::string password
 
std::string database
 
std::string host
 
std::string port_or_socket
 
std::string ssl
 

Detailed Description

Constructor & Destructor Documentation

◆ MySQLConnectionInfo()

MySQLConnectionInfo::MySQLConnectionInfo ( std::string_view  infoString)
explicit
35{
36 std::vector<std::string_view> tokens = Acore::Tokenize(infoString, ';', true);
37
38 if (tokens.size() != 5 && tokens.size() != 6)
39 return;
40
41 host.assign(tokens.at(0));
42 port_or_socket.assign(tokens.at(1));
43 user.assign(tokens.at(2));
44 password.assign(tokens.at(3));
45 database.assign(tokens.at(4));
46
47 if (tokens.size() == 6)
48 ssl.assign(tokens.at(5));
49}
std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
Definition: Tokenize.cpp:20
std::string host
Definition: MySQLConnection.h:50
std::string port_or_socket
Definition: MySQLConnection.h:51
std::string user
Definition: MySQLConnection.h:47
std::string database
Definition: MySQLConnection.h:49
std::string ssl
Definition: MySQLConnection.h:52
std::string password
Definition: MySQLConnection.h:48

References database, host, password, port_or_socket, ssl, Acore::Tokenize(), and user.

Member Data Documentation

◆ database

◆ host

◆ password

std::string MySQLConnectionInfo::password

◆ port_or_socket

◆ ssl

std::string MySQLConnectionInfo::ssl

◆ user

std::string MySQLConnectionInfo::user