1/* 2 * Copyright 2020, Stephan A��mus <superstippi@gmx.de> 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _PACKAGE__PRIVATE__FETCH_UTILS_H_ 6#define _PACKAGE__PRIVATE__FETCH_UTILS_H_ 7 8 9#include "SupportDefs.h" 10#include <Node.h> 11 12namespace BPackageKit { 13 14namespace BPrivate { 15 16 17class FetchUtils { 18public: 19 static bool IsDownloadCompleted(const char* path); 20 static bool IsDownloadCompleted(const BNode& node); 21 22 static status_t MarkDownloadComplete(const char* path); 23 static status_t MarkDownloadComplete(BNode& node); 24 25 static status_t SetFileType(BNode& node, const char* type); 26 27private: 28 static status_t _SetAttribute(BNode& node, 29 const char* attrName, 30 type_code type, const void* data, 31 size_t size); 32 static status_t _GetAttribute(const BNode& node, 33 const char* attrName, 34 type_code type, void* data, 35 size_t size); 36}; 37 38 39} // namespace BPrivate 40 41} // namespace BPackageKit 42 43 44#endif // _PACKAGE__PRIVATE__FETCH_UTILS_H_ 45