4 #include <jsoncpp/json/json.h>
6 // Log docs: https://github.com/gabime/spdlog
7 #include <spdlog/spdlog.h>
8 namespace spd = spdlog;
15 typedef std::map<std::string, std::string> PFMap;
20 bool process(std::string& request, PFMap& postFields, std::string& returnData);
23 std::shared_ptr<spd::logger> logger;
24 bool gettime(PFMap& postFields, Json::Value& returnJSON);
25 bool diskstats(PFMap& postFields, Json::Value& returnJSON);
26 bool channellist(PFMap& postFields, Json::Value& returnJSON);
27 bool reclist(PFMap& postFields, Json::Value& returnJSON);
28 bool timerlist(PFMap& postFields, Json::Value& returnJSON);
29 bool epgdownload(PFMap& postFields, Json::Value& returnJSON);
30 bool tunersstatus(PFMap& postFields, Json::Value& returnJSON);
32 bool channelschedule(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
33 bool getscheduleevent(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
34 bool epgsearch(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
35 bool epgsearchsame(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
36 bool timerset(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
37 bool recinfo(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
38 bool recstop(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
39 bool recdel(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
40 bool recrename(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
41 bool recmove(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
42 bool timersetactive(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
43 bool timerdel(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
44 bool timerisrecording(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
45 bool recresetresume(PFMap& postFields, Json::Value& returnJSON); // throws BadParamException
46 bool timeredit(PFMap& postFields, Json::Value& returnJSON);
48 cTimer* findTimer(const char* rChannelID, const char* rName, const char* rStartTime, const char* rStopTime, const char* rWeekDays);
49 cTimer* findTimer2(const char* rName, const char* rActive, const char* rChannelID, const char* rDay, const char* rWeekDays, const char* rStartTime, const char* rStopTime, const char* rPriority, const char* rLifetime);
50 const cEvent* getEvent(Json::Value& js, int channelNumber, int eventID, int aroundTime);
52 void pathsForRecordingName(const std::string& recordingName,
53 std::string& dirNameSingleDate,
54 std::string& dirNameSingleTitle,
55 std::string& dirNameSingleFolder,
56 std::string& dirNameFullPathTitle,
57 std::string& dirNameFullPathDate); // throws int
59 int getVarInt(PFMap& postFields, const char* paramName); // THROWS
60 std::string getVarString(PFMap& postFields, const char* paramName); // THROWS
62 class BadParamException : public std::exception
66 BadParamException(const char* _param) { param = _param; }
68 virtual const char* what() const throw()