Add request type(/m3u) for Vu+PlayerHD (IOS).
[vuplus_transtreamproxy] / src / Util.h
1 /*
2  * Utils.h
3  *
4  *  Created on: 2014. 6. 10.
5  *      Author: oskwon
6  */
7
8 #ifndef UTILS_H_
9 #define UTILS_H_
10
11 #include <map>
12 #include <string>
13 #include <vector>
14
15 #include <stdint.h>
16
17 #include "Http.h"
18 #include "Source.h"
19 #include "Encoder.h"
20 //----------------------------------------------------------------------
21
22 class Util {
23 public:
24         static void     vlog(const char * format, ...) throw();
25
26         static int strtollu(std::string data);
27         static std::string ultostr(int64_t data);
28
29         static std::string trim(std::string& s, const std::string& drop = " \t\n\v\r");
30
31         static int split(std::string data, const char delimiter, std::vector<std::string>& tokens);
32         static bool split_key_value(std::string data, std::string delimiter, std::string &key, std::string &value);
33
34         static void kill_process(int pid);
35
36         static std::string host_addr();
37
38         static std::vector<int> find_process_by_name(std::string name, int mypid);
39 };
40 //----------------------------------------------------------------------
41
42 typedef struct _thread_params_t {
43         Source *source;
44         Encoder *encoder;
45         HttpHeader *request;
46 } ThreadParams;
47 //----------------------------------------------------------------------
48
49 #endif /* UTILS_H_ */