2020-12-30 22:07:54 -06:00
|
|
|
/*
|
|
|
|
* Copyright 2020, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
|
|
*/
|
2020-07-04 10:27:38 -05:00
|
|
|
#ifndef UTIL_H
|
|
|
|
#define UTIL_H
|
|
|
|
|
2020-07-06 04:39:30 -05:00
|
|
|
#include <DateTime.h>
|
2020-12-30 22:07:54 -06:00
|
|
|
|
2020-07-04 10:27:38 -05:00
|
|
|
#include "ProtocolListener.h"
|
|
|
|
|
2020-12-30 22:07:54 -06:00
|
|
|
class BUrl;
|
|
|
|
|
|
|
|
|
|
|
|
BDateTime feedDateToBDate(const char*);
|
|
|
|
BDateTime dateRfc3339ToBDate(const char*);
|
|
|
|
BDateTime dateRfc822ToBDate(const char*);
|
|
|
|
BDateTime stringDateToBDate(const char*, const char*);
|
2020-07-06 04:39:30 -05:00
|
|
|
|
2020-12-30 22:07:54 -06:00
|
|
|
BString dateTo3339String(BDateTime);
|
2020-07-06 04:39:30 -05:00
|
|
|
|
2020-12-30 22:07:54 -06:00
|
|
|
bool withinDateRange(BDateTime, BDateTime, BDateTime);
|
2020-07-06 04:39:30 -05:00
|
|
|
|
2020-12-30 22:07:54 -06:00
|
|
|
bool isRemotePath(BString);
|
|
|
|
|
2021-01-11 18:08:15 -06:00
|
|
|
BString urlToFilename(BUrl url);
|
|
|
|
|
2021-01-11 11:41:46 -06:00
|
|
|
int32 fetch(BUrl url, BDataIO* reply, BString* hash, int timeout);
|
2020-11-16 18:46:07 -06:00
|
|
|
|
2021-01-28 00:19:36 -06:00
|
|
|
void userFileError(status_t status, const char* path);
|
2020-07-04 10:27:38 -05:00
|
|
|
|
2021-01-28 00:19:36 -06:00
|
|
|
|
|
|
|
#endif // UTIL_H
|
2020-12-30 22:07:54 -06:00
|
|
|
|