OpenMining  0.01
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
utils.h
Go to the documentation of this file.
1 /*
2  Copyright 2014 Daniel McInnes
3 
4  This file is part of OpenMining.
5 
6  OpenMining is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OpenMining is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OpenMining. If not, see <http://www.gnu.org/licenses/>.
18 
19 */
20 
21 #ifndef UTILS_H
22 #define UTILS_H
23 
24 // standard library includes
25 #include <string>
26 #include <iostream>
27 
28 // boost includes
29 #include <boost/archive/text_iarchive.hpp>
30 #include <boost/archive/text_oarchive.hpp>
31 #include <boost/serialization/vector.hpp>
32 
33 // Qt includes
34 #include <QSqlQuery>
35 #include <QString>
36 #include <QStringList>
37 
38 // my includes
39 //#include "location.h"
40 //#include "elevation.h"
41 
42 #define FN __PRETTY_FUNCTION__
43 #define CLASS typeid(*this).name()
44 //#define CLASS (const std::string(typeid(*this).name()))
45 class Location;
46 
47 namespace utils{
48  std::string timestamp(void);
49  bool contains_key(const QStringList& args, const char* key);
50  void csl_2_vec(QSqlQuery& query, int index, const char* separator, std::vector<int>& vec, int& val);
51 
52  void exit_if_no_cachefile_specified(const QStringList& args, const std::string& key, std::string& dest, const std::string& functionName);
53 
54 /*
55  bool Exit(const char* msg, int32_t error_code);*/
56  void usage();
57 
58 } // namespace
59 #endif
bool contains_key(const QStringList &args, const char *key)
Definition: utils.cpp:49
void csl_2_vec(QSqlQuery &query, int index, const char *separator, std::vector< int > &vec, int &val)
Definition: utils.cpp:57
void usage()
Definition: utils.cpp:77
void exit_if_no_cachefile_specified(const QStringList &args, const string &key, string &dest, const string &functionName)
Definition: utils.cpp:66
Definition: location.h:45
std::string timestamp(void)
Definition: utils.cpp:40