-
Notifications
You must be signed in to change notification settings - Fork 4
/
servermanager.h
49 lines (41 loc) · 1.38 KB
/
servermanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Copyright 2010 Jean Fairlie jmfairlie@gmail.com
This file is part of CacaMap
CacaMap is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef _SRVRMGR
#define _SRVRMGR
#include <QtXml>
struct tileserver
{
QString name;/**<name of the tile server*/
QString url;/**< url template for accessing tiles*/
QString folder;/**< name of folder where tiles will be stored*/
QString path;/**< path where tiles will be stored*/
QString tile;/**< tile file*/
};
class servermanager
{
public:
bool loadConfigFile(QString);
QString getTileUrl(int,quint32,quint32);
QString tileCacheFolder();
//returns the filename of the file as it should be stored in HD
QString fileName(quint32);
void selectServer(int);
QString serverName();
QString filePath(int, quint32);
QStringList getServerNames();
private:
QVector<tileserver> serverlist;/**< list of server structs*/
int selectedServer;/**< index in list of current server*/
QStringList serverNames;/**< names of servers in xml file*/
};
#endif