Fork HTTPClient and Modfiy code for mbed 6.0
Dependents: mbed-demo-http-get-json
Diff: data/HTTPiCal.h
- Revision:
- 40:bcb19f8dbba3
- Parent:
- 39:21fc7a4b6927
--- a/data/HTTPiCal.h Fri Mar 10 02:53:09 2017 +0000 +++ b/data/HTTPiCal.h Tue Mar 14 02:59:32 2017 +0000 @@ -103,7 +103,45 @@ /// @returns true if the event was available and copied. /// bool GetEvent(unsigned int i, Event_T * event); + + + /// Compute the intersection of two time ranges, and evaluate the recurringing events. + /// + /// This compares a pair of time ranges, each by a start and end time. If they overlap + /// it then computes the intersection of those two ranges. Additionally, for a + /// specified Event, it will evaluate the recurring events that may also fall into + /// the target time range. + /// + /// @note This is usually the only API you need, as this will first call + /// the TimeIntersects function, and if that fails, then it will evaluate + /// repeat information. + /// + /// @param[in,out] start1 is the starting time of range 1. + /// @param[in,out] end1 is the ending time of range 1. + /// @param[in] start2 is the starting time of range 2. + /// @param[in] end2 is the ending time of range 2. + /// @param[in] Event is a pointer to the event of interest that may have recurring series. + /// @returns true if the ranges overlap, and then start1 and end1 are set to the + /// intersection. + /// + bool RepeatIntersects(time_t * start1, time_t * end1, time_t * start2, time_t * end2, Event_T * Event = NULL); + + /// Compute the intersection of two time ranges, and returns that intersection. + /// + /// This compares a pair of time ranges, each by a start and end time. If they overlap + /// it then computes the intersection of those two ranges. + /// + /// @param[in,out] start1 is the starting time of range 1. + /// @param[in,out] end1 is the ending time of range 1. + /// @param[in] start2 is the starting time of range 2. + /// @param[in] end2 is the ending time of range 2. + /// @returns true if the ranges overlap, and then start1 and end1 are set to the + /// intersection. + /// + bool TimeIntersects(time_t * start1, time_t * end1, time_t * start2, time_t * end2); + + protected: friend class HTTPClient; @@ -157,9 +195,11 @@ } seekstate_t; seekstate_t seeking; + #if !defined(min) && !defined(max) #define min(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) - + #endif + /// Determine if a specific timestamp is in a leap year /// /// @param[in] t is the timestamp to evaluate @@ -232,12 +272,6 @@ int ParseICalStream(const char * pStart, time_t gridStartTime, time_t gridEndTime, tz_min_t tzoMin, bool showEvents = true); - /// Get the number of events that have been cached. - /// - /// @returns the number of events. - /// - int GetNumEvents(void); - /// Compute if the referenced event occurs within the specified time window. /// /// @param[in] startWindow is the starting timestamp. @@ -245,45 +279,9 @@ /// @param[in] Event is a pointer to the event, which can have repeat rules. /// @returns true if the event laps into the current time window. /// - bool EventIntersects(time_t startWindow, time_t endWindow, Event_T * Event); - - /// Compute the intersection of two time ranges, and evaluate the recurringing events. - /// - /// This compares a pair of time ranges, each by a start and end time. If they overlap - /// it then computes the intersection of those two ranges. Additionally, for a - /// specified Event, it will evaluate the recurring events that may also fall into - /// the target time range. - /// - /// @note This is usually the only API you need, as this will first call - /// the TimeIntersects function, and if that fails, then it will evaluate - /// repeat information. - /// - /// @param[in,out] start1 is the starting time of range 1. - /// @param[in,out] end1 is the ending time of range 1. - /// @param[in] start2 is the starting time of range 2. - /// @param[in] end2 is the ending time of range 2. - /// @param[in] Event is a pointer to the event of interest that may have recurring series. - /// @returns true if the ranges overlap, and then start1 and end1 are set to the - /// intersection. - /// - bool RepeatIntersects(time_t * start1, time_t * end1, time_t * start2, time_t * end2, Event_T * Event = NULL); - - - /// Compute the intersection of two time ranges, and returns that intersection. - /// - /// This compares a pair of time ranges, each by a start and end time. If they overlap - /// it then computes the intersection of those two ranges. - /// - /// @param[in,out] start1 is the starting time of range 1. - /// @param[in,out] end1 is the ending time of range 1. - /// @param[in] start2 is the starting time of range 2. - /// @param[in] end2 is the ending time of range 2. - /// @returns true if the ranges overlap, and then start1 and end1 are set to the - /// intersection. - /// - bool TimeIntersects(time_t * start1, time_t * end1, time_t * start2, time_t * end2); - - +// bool EventIntersects(time_t startWindow, time_t endWindow, Event_T * Event); + + // Private Functions - no real value external to the iCal public interface // other than for test code.