xref: /haiku/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.h (revision f84c53e4acb4c8a9e4dadd4ce165ca3a126114b1)
1 /*
2  * Copyright 2017-2018, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef PACKAGE_DATA_UPDATE_PROCESS_H
6 #define PACKAGE_DATA_UPDATE_PROCESS_H
7 
8 
9 #include "AbstractSingleFileServerProcess.h"
10 
11 #include <File.h>
12 #include <Path.h>
13 #include <String.h>
14 #include <Url.h>
15 
16 #include "Model.h"
17 #include "PackageInfo.h"
18 
19 
20 class ServerPkgDataUpdateProcess : public AbstractSingleFileServerProcess {
21 public:
22 								ServerPkgDataUpdateProcess(
23 									BString naturalLanguageCode,
24 									BString depotName,
25 									Model *model,
26 									uint32 serverProcessOptions);
27 	virtual						~ServerPkgDataUpdateProcess();
28 
29 			const char*			Name() const;
30 			const char*			Description() const;
31 
32 protected:
33 	virtual status_t			RunInternal();
34 
35 			status_t			GetStandardMetaDataPath(BPath& path) const;
36 			void				GetStandardMetaDataJsonPath(
37 									BString& jsonPath) const;
38 
39 			BString				UrlPathComponent();
40 			status_t			ProcessLocalData();
41 			status_t			GetLocalPath(BPath& path) const;
42 
43 private:
44 			BString				_DeriveWebAppRepositorySourceCode() const;
45 
46 			BString				fNaturalLanguageCode;
47 			Model*				fModel;
48 			BString				fDepotName;
49 			BString				fName;
50 			BString				fDescription;
51 
52 };
53 
54 #endif // PACKAGE_DATA_UPDATE_PROCESS_H
55