/*----------------------------------------------------------------------------*/ /* Copyright (c) 2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #ifndef RPICONFIGSERVER_APPLICATION_H_ #define RPICONFIGSERVER_APPLICATION_H_ #include #include #include #include #include #include namespace wpi { class json; } // namespace wpi class Application { struct private_init {}; public: explicit Application(const private_init&) {} Application(const Application&) = delete; Application& operator=(const Application&) = delete; void Set(wpi::StringRef appType, std::function onFail); int StartUpload(wpi::StringRef appType, char* filename, std::function onFail); void Upload(int fd, bool text, wpi::ArrayRef contents); void FinishUpload(wpi::StringRef appType, int fd, const char* tmpFilename, std::function onFail); void UpdateStatus(); wpi::json GetStatusJson(); wpi::sig::Signal status; static std::shared_ptr GetInstance(); }; #endif // RPICONFIGSERVER_APPLICATION_H_