Danbias/Code/Game/DanBiasServer/Helpers/ServerDataReader.h

45 lines
861 B
C
Raw Normal View History

2014-01-07 10:26:09 +01:00
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
2013-12-12 09:33:59 +01:00
#ifndef DANBIASSERVER_SERVER_INIT_READER_H
#define DANBIASSERVER_SERVER_INIT_READER_H
#include <fstream>
#include <string>
namespace DanBias
{
enum InitPath
{
InitPath_ServerIni,
};
2013-12-19 12:32:23 +01:00
static std::string GetInitPath(InitPath file)
2013-12-12 09:33:59 +01:00
{
std::string type = "";
std::string path = "";
std::string flag = "";
switch (file)
{
case DanBias::InitPath_ServerIni:
flag = "ServerInit";
break;
}
std::fstream in;
in.open("..\\Settings\\serversearchpath.ini", std::ios::in);
if(!in.is_open()) return "";
while (!in.eof() && type != flag)
{
in >> type;
in >> path;
}
in.close();
return path;
}
}
#endif // !DANBIASSERVER_SERVER_INIT_READER_H